Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Calendar Package >

DateQ

DateQ[{year, month, day}]
yields True if date {year, month, day} is a valid date in the current calendar system, and yields False otherwise.
DateQ[{year, month, day, hour, minute, second}]
date given in long form {year, month, day, hour, minute, second}.
  • The following options can be given:
CalendarAutomaticspecifies which calendar system to use
  • The default calendar is the usual Western (American) calendar, but can be changed with the Calendar option.
Needs["Calendar`"]
DateQ recognizes ordinary Western dates:
In[2]:=
Click for copyable input
Out[2]=
 
Needs["Calendar`"]
DateQ will identify leap years. The year 2000 was a leap year:
In[2]:=
Click for copyable input
Out[2]=
 
Needs["Calendar`"]
The year 1900 was not a leap year:
In[2]:=
Click for copyable input
Out[2]=
 
Needs["Calendar`"]
By default, Mathematica 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]=
 
Needs["Calendar`"]
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]=
© 2013 Wolfram Research, Inc. Japanese
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team