DaysBetween

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


gives the number of days between the dates and .


gives the number of days between the given dates.

更多信息更多信息

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

基本范例  (7)基本范例  (7)

In[1]:=
Click for copyable input

The number of days between consecutive days is 1:

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

The number of days between the same date is 0:

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

If the second date is earlier than the first date, then a negative result is returned:

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

John F. Kennedy's presidency is referred to as lasting 1000 days:

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

Hours, minutes, and seconds do not affect :

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

In the default (Western/American) calendar, 11 days were deleted in September 1752:

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

In the default (Western/American) calendar, 1752 had 355 days:

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