DateQ

As of Version 10.0, calendar functionality is built into the Wolfram Language


yields True if date is a valid date in the current calendar system, and yields False otherwise.


date given in long form .

DetailsDetails

ExamplesExamplesopen allclose all

Basic Examples  (5)Basic Examples  (5)

In[1]:=
Click for copyable input

recognizes ordinary Western dates:

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

will identify leap years. The year 2000 was a leap year:

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

The year 1900 was not a leap year:

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

By default, the Wolfram Language uses the standard Western (British/American) calendar. The British/American calendar applies the Julian calendar to dates before 1752 and the Gregorian calendar after:

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

The default British/American calendar deletes the dates September 3 to 13, 1752:

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