DateTimePeriod

fun DateTimePeriod(    years: Int = 0,     months: Int = 0,     days: Int = 0,     hours: Int = 0,     minutes: Int = 0,     seconds: Int = 0,     nanoseconds: Long = 0): DateTimePeriod

Constructs a new DateTimePeriod. If all the time components are zero, returns a DatePeriod.

It is recommended to always explicitly name the arguments when constructing this manually, like DateTimePeriod(years = 1, months = 12).

The passed numbers are not stored as is but are normalized instead for human readability, so, for example, DateTimePeriod(months = 24) becomes DateTimePeriod(years = 2).

Throws

if the total number of months in hours, minutes, seconds and nanoseconds overflows a Long.