PRODUCTS
Products Overview
Mathematica
Mathematica for Students
Mathematica Home Edition
Wolfram
CDF Player
(free download)
Computable Document Format (CDF)
web
Mathematica
grid
Mathematica
Wolfram
Workbench
Wolfram
SystemModeler
Wolfram
Finance Platform
Mathematica
Add-Ons
Wolfram|Alpha Products
SOLUTIONS
Solutions Overview
Engineering
Aerospace Engineering & Defense
Chemical Engineering
Control Systems
Electrical Engineering
Image Processing
Industrial Engineering
Materials Science
Mechanical Engineering
Operations Research
Optics
Petroleum Engineering
Biotechnology & Medicine
Bioinformatics
Medical Imaging
Finance, Statistics & Business Analysis
Actuarial Sciences
Data Analysis & Mining
Econometrics
Economics
Financial Engineering & Mathematics
Financial Risk Management
Statistics
Software Engineering & Content Delivery
Authoring & Publishing
Interface Development
Software Engineering
Web Development
Science
Astronomy
Biological Sciences
Chemistry
Environmental Sciences
Geosciences
Social & Behavioral Sciences
Design, Arts & Entertainment
Game Design, Special Effects & Generative Art
Education
STEM Education Initiative
Higher Education
Community & Technical College Education
Primary & Secondary Education
Students
Technology
Computable Document Format (CDF)
High-Performance & Parallel Computing (HPC)
See Also: Technology Guide
PURCHASE
Online Store
Other Ways to Buy
Volume & Site Licensing
Contact Sales
Software
Service
Upgrades
Training
Books
Merchandise
SUPPORT
Support Overview
Knowledge Base
Learning Center
Community & Forums
Training
Does My Site Have a License?
Wolfram User Portal
COMPANY
About Wolfram Research
News & Events
Wolfram Blog
Partnerships
Employment Opportunities
History of
Mathematica
Stephen Wolfram's Home Page
Contact Us
OUR SITES
All Sites
Wolfram|Alpha
Demonstrations Project
MathWorld
Integrator
Wolfram Functions Site
Mathematica Journal
Wolfram Media
Wolfram
Tones
Wolfram Science
Stephen Wolfram
DOCUMENTATION CENTER SEARCH
New to
Mathematica
?
Find your learning path
»
Mathematica
>
Data Manipulation
>
Date & Time
>
DatePlus
>
BUILT-IN MATHEMATICA SYMBOL
DateDifference
DateString
DateList
DateListPlot
DatePattern
ScheduledTasks
See Also »
|
Date & Time
New in 6.0: Data Handling & Data Sources
More About »
DatePlus
DatePlus
gives the date
n
days after
date
.
DatePlus
gives the date
n
units after
date
.
DatePlus
gives a date offset by
units of each specified size.
DatePlus
[
n
]
gives the date
n
days after the current date.
DatePlus
[
offset
]
gives the date with the specified offset from the current date.
MORE INFORMATION
DatePlus
gives the date
n
days before
date
.
Dates can be specified in the following forms:
{
y
,
m
,
d
}
year, month, day
{
y
,
m
}
the first day of the specified month
{
y
}
January 1 of the year
y
"
string
"
date as a string (
)
{
y
,
m
,
d
,
h
,
m
,
s
}
precise time
time
absolute time specification
Possible offset units are
,
,
,
,
,
,
,
.
is taken to be equivalent to
, etc.
DatePlus
gives results in the same general format as
date
.
When
date
is a list, the result has the same length as
date
, possibly extended to include the smallest unit in
offset
.
»
When
date
is a string, the result is in the form specified by
$DateStringFormat
.
EXAMPLES
CLOSE ALL
Basic Examples
(5)
Add 35 days to January 1, 2009:
Use a date string as input:
Subtract from a date:
Add 14 weeks to a date:
Add 34 days to the current time:
Add 35 days to January 1, 2009:
In[1]:=
Out[1]=
Use a date string as input:
In[1]:=
Out[1]=
Subtract from a date:
In[1]:=
Out[1]=
Add 14 weeks to a date:
In[1]:=
Out[1]=
Add 34 days to the current time:
In[1]:=
Out[1]=
Scope
(12)
DatePlus
can take dates in the standard
format of
DateList
:
DatePlus
can take dates in any format supported by
DateString
:
If a date is given as
,
DatePlus
returns in the same form:
is interpreted as the first day of the specified month:
{
y
}
is interpreted as January 1 of the specified year:
Add 10 months to a date:
Add 40 weeks to a date:
Add 7 weeks and 2 days:
Lists are extended to include smaller offset units:
Add 1 year to a date list:
Add 1 month and 15 days to the specified date list:
Add 2.45 days:
Subtract 4.6 hours:
Properties & Relations
(2)
DatePlus
adds time units to dates, while
DateDifference
computes units between dates:
The inverse relationship:
Use
$DateStringFormat
to set the default format for date strings:
Possible Issues
(1)
Dates can be ambiguous:
Use
DateList
to disambiguate between different interpretations:
SEE ALSO
DateDifference
DateString
DateList
DateListPlot
DatePattern
ScheduledTasks
MORE ABOUT
Date & Time
New in 6.0: Data Handling & Data Sources
New in 6