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.

DetailsDetails

ExamplesExamplesopen allclose all

Basic Examples  (7)Basic Examples  (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]=