此为 Mathematica 7 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.1)

DaysPlus

DaysPlus[{year, month, day}, n]
gives the date n days after the date {year, month, day}.
DaysPlus[{year, month, day, hour, minute, second}, n]
gives the date n days after the date {year, month, day, hour, minute, second}.
  • The following options can be given:
CalendarAutomaticspecifies which calendar system to use
  • The default calendar is the usual American calendar, but can be changed with the Calendar option.
Needs["Calendar`"]
Computing the next day:
In[2]:=
Click for copyable input
Out[2]=
To compute an earlier date, a negative second argument is used:
In[3]:=
Click for copyable input
Out[3]=
 
Needs["Calendar`"]
Hours, minutes, and seconds are retained by DaysPlus:
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=