LeapYearQ

LeapYearQ[date]

returns True if the year corresponding to date is a leap year.

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")
    numberAbsoluteTime specification
  • The following options can be given:
  • CalendarType "Gregorian"calendar in which the date parameters have been specified

Examples

open allclose all

Basic Examples  (4)

Find whether a date is in a leap year:

Use a compact DateList:

An AbsoluteTime specification is allowed:

Use a string specification:

Options  (3)

CalendarType  (3)

A leap year in the Jewish calendar is defined as a year of 13 months:

In the Islamic tabular calendar, leap years are defined as those years that have a 30-day 12th month:

In the Julian calendar, every fourth year is a leap year:

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:

Wolfram Research (2012), LeapYearQ, Wolfram Language function, https://reference.wolfram.com/language/ref/LeapYearQ.html (updated 2014).

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

BibTeX

@misc{reference.wolfram_2024_leapyearq, author="Wolfram Research", title="{LeapYearQ}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/LeapYearQ.html}", note=[Accessed: 30-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_leapyearq, organization={Wolfram Research}, title={LeapYearQ}, year={2014}, url={https://reference.wolfram.com/language/ref/LeapYearQ.html}, note=[Accessed: 30-December-2024 ]}