DATETIMEADD        Add specified amount to the date and time variable

Top  Previous  Next

Syntax:

DATETIMEADD

[ variable ] [ const ] [ /options ]

Arguments:

[ variable ]

A variable containing the formatted date and time string in the format of Sat Feb 17 11.00.22 2001.

 

[ const ]

A variable or a numeric constant representing the amount of time to add to the date and time string contained in [ variable ].

Options:

/day

Add specified number of days.

 

/hour

Add specified number of hours.

 

/minute

Add specified number of minutes.

 

/second

Add specified number of seconds.

 

 

This script command is used to add a specified amount of time to the formatted date and time string variable. The [ /options ] argument must be specified.

 

Consider the example below where 14 days is added to a variable containing the current date and time.

 

SET today = %datetime

DATETIMEADD today 14DISPLAY /day

 

Consider the example below where 34 minutes is added to a variable containing the current date and time.

 

SET today = %datetime

DATETIMEADD today 34DISPLAY /minute

 

The number of days to add may also be expressed in a variable as shown below.

 

SET today = %datetime

SETNUM SETdays = 14

DATETIMEADD today days /day

 

The %datetime internal variable may not be used in this command directly.

 

Related Command(s): DATETIMESUB, IFDATETIME

See also: Using the %date, %datetime, and %time Variables