Calendar - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Date and Time : Calendar package : Calendar/IsLeapYear

Calendar

  

IsLeapYear

  

determine whether a year is a leap year

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

IsLeapYear( year )

Parameters

year

-

integer; the year

Description

• 

The IsLeapYear( year ) command determines whether year is a leap year.

• 

A "leap year" is a year in which there is added an extra day.  Prior to the year 1582, those years divisible by 4 were considered leap years, according to the Julian calendar introduced by Julius Caesar in 45 BCE. After the introduction of the Gregorian calendar in 1582 a more refined leap year rule was introduced: a year is a leap year if it is divisible by 4, but not by 100, unless it is divisible by 400.

• 

Note that, historically, leap year rules were applied inconsistently prior to the year 5, so the result of IsLeapYear( year ) may be historically inaccurate if year < 5. Even the historical record on the observation of leap years prior to the year 5 is unclear, and scholars disagree on the precise dates of intercalation in the period before the common era, a situation not helped by the apparent conflation of dates recorded in the (then new) Julian calendar, the old Roman calendar, the old Egyptian and new Alexandrian calendars, all simultaneously in use at the time. The IsLeapYear command makes no attempt to account for the historical record, and treats all dates prior to Gregorian calendar reform as though the Julian calendar leap year rules were applied consistently indefinitely into the past.

• 

Similarly, all dates after the year 1582 are treated as though the present, Gregorian leap year rules apply.

Examples

withCalendar&colon;

IsLeapYear2000

true

(1)

IsLeapYear1900

false

(2)

IsLeapYear1904

true

(3)

IsLeapYear4

true

(4)

Compatibility

• 

The Calendar[IsLeapYear] command was introduced in Maple 2018.

• 

For more information on Maple 2018 changes, see Updates in Maple 2018.

See Also

Calendar

Calendar[DaysInYear]