LeapYearQ
Details and Options
- The date can be specified in the following forms:
-
DateObject[…] date object {y,m,d} year, month, day {y,m} the first day of the specified month {y} the first day of the first month of the year y "string" date as a string ("Jan. 1, 2000") number AbsoluteTime specification - The following options can be given:
-
CalendarType "Gregorian" calendar in which the date parameters have been specified
Examples
open allclose allBasic Examples (4)
Find whether a date is in a leap year:
Use a compact DateList:
An AbsoluteTime specification is allowed:
Options (3)
Applications (1)
Find the periodicity of leap years in different calendars by analyzing a range of 5000 years:
In the Julian calendar, every fourth year is a leap year:
There are 97 leap years every 400 years in the Gregorian calendar:
In the Jewish calendar, there are 7 leap years every 19 years:
There are 11 leap years in each cycle of 30 years of the tabular Islamic calendar:
Possible Issues (1)
LeapYearQ accepts both DateList and AbsoluteTime specifications, so numeric inputs are treated as a number of seconds since 1900:
For year specifications, either a DateList or DateObject form should be used:
Text
Wolfram Research (2012), LeapYearQ, Wolfram Language function, https://reference.wolfram.com/language/ref/LeapYearQ.html (updated 2014).
CMS
Wolfram Language. 2012. "LeapYearQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/LeapYearQ.html.
APA
Wolfram Language. (2012). LeapYearQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LeapYearQ.html