DateQ


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


date given in long form .

更多信息更多信息

范例范例打开所有单元关闭所有单元

基本范例 (5)基本范例 (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, 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]=
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]=
New to Mathematica? Find your learning path »
Have a question? Ask support »