LeapYearQ

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

Details and OptionsDetails and Options

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

ExamplesExamplesopen allclose all

Basic Examples (4)Basic Examples (4)

Find whether a date is in a leap year:

In[1]:=
Click for copyable input
Out[1]=

Use a more compact DateList:

In[1]:=
Click for copyable input
Out[1]=

An AbsoluteTime specification is allowed:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Use a string specification:

In[1]:=
Click for copyable input
Out[1]=
New in 9
New to Mathematica? Find your learning path »
Have a question? Ask support »