DATESUB Subtract specified number of days from a date variable |
Top Previous Next |
This script command is used to subtract a specified number of days from a date variable.
Note: The %date internal variable should not be passed directly in the [ variable ] argument of this command. To use the value of %date with DATESUB 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 subtract from a variable containing the current date.
DATESUB today 14 DISPLAY today
The number of days to subtract may also be expressed in a variable as shown below.
SET today = %date SETNUM days = 14 DATESUB today days DISPLAY today
Related command(s): DATEADD, IFDATE, DATETIMEADD, DATETIMESUB, IFDATETIME See also: Using the %date, %datetime, and %time Variables, Comparing Local and Remote Files, Comparing File Dates and Times |