DATETIMEADD Add specified amount to the date and time variable |
Top Previous Next |
This script command is used to add a specified amount of time to the formatted date and time string variable. The [ /options ] argument is required.
Note: The %datetime internal variable should not be passed directly in the [ variable ] argument of this command. To use the value of %datetime with DATETIMEADD you must first assigned its value to to an intermediate user defined variable, and then pass that user defined variable as an argument.
Consider the example below where 14 days is added to a variable containing the current date and time.
DATETIMEADD today 14 /day DISPLAY today
Consider the example below where 34 minutes is added to a variable containing the current date and time.
SET today = %datetime DATETIMEADD today 34 /minute DISPLAY today
The number of days to add may also be expressed in a variable as shown below.
SET today = %datetime SETNUM days = 14 DATETIMEADD today days /day DISPLAY today
Related command(s): DATETIMESUB, IFDATETIME, DATEADD, DATESUB, IFDATE, IFTIME See also: Using the %date, %datetime, and %time Variables, Comparing Local and Remote Files, Comparing File Dates and Times |