VBScript DateAdd Function
Complete VBScript Reference Manual
The DateAdd function returns a date to which a specified time interval has been added.
Syntax
DateAdd(interval,number,date)
| Parameters | Description |
|---|---|
| interval | Required. The time interval you want to add.
The following values can be used: |
Example
Example 1
How to use the parameters:
The example above produces the following output:
1/31/2011
4/30/2010
2/28/2010
2/1/2010
2/1/2010
2/1/2010
2/7/2010
1/31/2010 9:50:00 AM
1/31/2010 8:51:00 AM
1/31/2010 8:50:01 AM
Try it »
Example 2
Subtract one month from January 31, 2001:
The example above produces the following output:
12/31/2009
Try it »
Example 3
Add one day to the current date:
The example above produces the following output:
document.write(DateAdd("d",1,Now()))
Try it »
Complete VBScript Reference Manual