DateTime.year

short year() @property const @safe pure nothrow @nogc

Year of the Gregorian Calendar. Positive numbers are A.D. Non-positive are B.C.

void year(int year) @property @safe pure

Year of the Gregorian Calendar. Positive numbers are A.D. Non-positive are B.C.

Parameters

yearThe year to set this DateTime's year to.

Throws

DateTimeException if the new year is not

a leap year and if the resulting date would be on February 29th.