OffsetDate

This function adds some number of timesteps to a given date/time and returns the result.

Description

Returns the date/time which is some number of timesteps added to or subtracted from an input date/time.

Type

DATETIME

Arguments

Type

Meaning

1

DATETIME

a date/time.

2

NUMERIC

the number of timesteps to add (a negative number will subtract). Should have units of "NONE".

3

STRING

a timestep specification.

This specification includes an integer which can be positive or negative. Examples include "1 MONTH", "2 hours". Case is not important in this string.

Evaluation

Adds the given timestep, to the given date, to the given number of times, then returns the result.

Comments

If the second argument has units other than "NONE", or if the third argument is not recognized as a timestep, then the run is aborted with an error.

  • Although one can put any integral amount within the timestep specification, if one makes this integer 1, then the second argument allows (1) one to vary the increment at the time of rule execution.

Additional information on datetime math can be found

 
OffsetDate(@"t", 1, "1 Months")
OffsetDate(@"January 1, 2000", getIncr(), "1 Hours")
 
@"July 31, 2007"