DatePlus
✖
DatePlus
Details and Options



- DatePlus shifts dates by any given amount of time, treated either as a physical duration or as a number of calendar steps.
- DatePlus[date,-n] gives the date n days before date.
- Dates can be specified in the following forms:
-
DateObject[…] date object {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 ("Jan. 1, 2000") {y,m,d,h,m,s} precise time time absolute time specification - Possible step sizes are calendar steps and day types "Year", "Quarter", "Month", "Week", "Day", "Hour", "Minute", "Second", "Weekday", "Weekend", Monday through Sunday, "EndOfMonth", "BeginningOfMonth" and "BusinessDay".
- Offsets can also be specified using the Quantity framework.
- {y,m,d} is taken to be equivalent to {y,m,d,0,0,0} etc.
- DatePlus[date,offset] 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 step in offset. »
- When date is a string, the result is in the form specified by $DateStringFormat.
- DatePlus takes the following options:
-
CalendarType "Gregorian" calendar in which the dates have been specified HolidayCalendar Automatic holiday schedule and subspecification for the business day and holiday computations Method Automatic date arithmetic method to use - For added time steps with variable duration (e.g. "Month"), date arithmetic can either convert the steps into a physical duration (continuous arithmetic) or treat them all as discrete calendar steps (discrete arithmetic).
- The option value Method"Continuous" implements continuous arithmetic. Discrete arithmetic is implemented with Methodrolling, where possible rolling methods are "RollForward", "RollBackward" and "RollOver", with the default being "RollBackward".
- For discrete arithmetic, adding, for example, a month may result in a date that does not exist (e.g. February 30). In such cases, there are three possible options for how that date should be resolved:
-
"RollBackward" roll back to the last existing date (Feb 28) "RollForward" roll forward to the next existing date (Mar 1) "RollOver" increment from the next existing date (Mar …)
Examples
open allclose allBasic Examples (5)Summary of the most common use cases
Add 35 days to January 1, 2017:

https://wolfram.com/xid/0cg4y18ci-r47qon


https://wolfram.com/xid/0cg4y18ci-b6z1sn


https://wolfram.com/xid/0cg4y18ci-fz3cfm


https://wolfram.com/xid/0cg4y18ci-foa2vf

Add 34 days to the current date:

https://wolfram.com/xid/0cg4y18ci-mfx56

Scope (13)Survey of the scope of standard use cases
Date Formats (5)
DatePlus can take dates in the standard {y,m,d,h,m,s} format of DateList:

https://wolfram.com/xid/0cg4y18ci-bfpcg1

DatePlus can take dates in any format supported by DateString:

https://wolfram.com/xid/0cg4y18ci-by8qve


https://wolfram.com/xid/0cg4y18ci-gqu7c9

If a date is given as {y,m,d}, DatePlus returns in the same form:

https://wolfram.com/xid/0cg4y18ci-chx1uk

{y,m} is interpreted as the first day of the specified month:

https://wolfram.com/xid/0cg4y18ci-e24nac

{y} is interpreted as January 1 of the specified year:

https://wolfram.com/xid/0cg4y18ci-dbd5sn

Increments (8)

https://wolfram.com/xid/0cg4y18ci-jjikai


https://wolfram.com/xid/0cg4y18ci-cnot2z


https://wolfram.com/xid/0cg4y18ci-bfamhk


https://wolfram.com/xid/0cg4y18ci-j0wqm8

Add 1 month and 15 days to the specified date:

https://wolfram.com/xid/0cg4y18ci-fb5pc

The increment can be specified using the quantity framework:

https://wolfram.com/xid/0cg4y18ci-ffy1gd


https://wolfram.com/xid/0cg4y18ci-gbwmz2


https://wolfram.com/xid/0cg4y18ci-ggkvn

Options (7)Common values & functionality for each option
CalendarType (2)
HolidayCalendar (2)
Method (3)
By default, adding a month to May 31 will roll back to June 30:

https://wolfram.com/xid/0cg4y18ci-sj4lza

Using Method"RollForward" will roll forward to the next valid date, July 1:

https://wolfram.com/xid/0cg4y18ci-5nl73b

DatePlus[date,"Year"] will move forward 365 or 366 days, depending on the year:

https://wolfram.com/xid/0cg4y18ci-tey3do


https://wolfram.com/xid/0cg4y18ci-fklw7v

Quantity[1,"Years"] is equivalent to Quantity[365,"Days"] in the Quantity framework:

https://wolfram.com/xid/0cg4y18ci-p1ostv

Therefore Method"Continuous" will always add 365 days:

https://wolfram.com/xid/0cg4y18ci-tn3okc


https://wolfram.com/xid/0cg4y18ci-kz9xvv

Compare the results of different arithmetic methods when adding a month to January 30, 2021:

https://wolfram.com/xid/0cg4y18ci-qooahe

Compare the results of different rolling methods for January 27 through February 1:

https://wolfram.com/xid/0cg4y18ci-if16kw

Applications (1)Sample problems that can be solved with this function
Properties & Relations (2)Properties of the function, and connections to other functions
DatePlus adds calendar steps to dates, while DateDifference computes time distances between dates:

https://wolfram.com/xid/0cg4y18ci-bgkmgv


https://wolfram.com/xid/0cg4y18ci-g7wybo


https://wolfram.com/xid/0cg4y18ci-is0ti


https://wolfram.com/xid/0cg4y18ci-ec0owb

Use $DateStringFormat to set the default format for date strings:

https://wolfram.com/xid/0cg4y18ci-koz9h

Possible Issues (3)Common pitfalls and unexpected behavior

https://wolfram.com/xid/0cg4y18ci-chd2l


Use DateList to disambiguate between different interpretations:

https://wolfram.com/xid/0cg4y18ci-d7633i

When list increments are specified, they are added from highest order to lowest:

https://wolfram.com/xid/0cg4y18ci-snrcdk


https://wolfram.com/xid/0cg4y18ci-9ehi4c


https://wolfram.com/xid/0cg4y18ci-27ibu0

The order in which calendar units are added can change the results of arithmetic operations, due to variable lengths for months and years:

https://wolfram.com/xid/0cg4y18ci-71ooji


https://wolfram.com/xid/0cg4y18ci-gi6p4i


https://wolfram.com/xid/0cg4y18ci-hv04a2

Wolfram Research (2007), DatePlus, Wolfram Language function, https://reference.wolfram.com/language/ref/DatePlus.html (updated 2023).
Text
Wolfram Research (2007), DatePlus, Wolfram Language function, https://reference.wolfram.com/language/ref/DatePlus.html (updated 2023).
Wolfram Research (2007), DatePlus, Wolfram Language function, https://reference.wolfram.com/language/ref/DatePlus.html (updated 2023).
CMS
Wolfram Language. 2007. "DatePlus." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/DatePlus.html.
Wolfram Language. 2007. "DatePlus." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/DatePlus.html.
APA
Wolfram Language. (2007). DatePlus. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DatePlus.html
Wolfram Language. (2007). DatePlus. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DatePlus.html
BibTeX
@misc{reference.wolfram_2025_dateplus, author="Wolfram Research", title="{DatePlus}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/DatePlus.html}", note=[Accessed: 29-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_dateplus, organization={Wolfram Research}, title={DatePlus}, year={2023}, url={https://reference.wolfram.com/language/ref/DatePlus.html}, note=[Accessed: 29-March-2025
]}