Gregorian.addMonths

Overridden. Returns a new Time with the specified number of months added. If the months are negative, the months are subtracted.

If the target month does not support the day component of the input time, then an error will be thrown, unless truncateDay is set to true. If truncateDay is set to true, then the day is reduced to the maximum day of that month.

For example, adding one month to 1/31/2000 with truncateDay set to true results in 2/28/2000.

class Gregorian
override const
Time
addMonths
(
const(Time) t
,,
bool truncateDay = false
)

Return Value

Type: Time

A Time that represents the provided time with the number of months added.

Meta