Chaining Actions for Relative Times

Relative times are created by chaining time actions together - these are separated with a comma. For example, to calculate the last day of the current month, you would chain the following commands together:

"MONTH+1,DAY_OF_MONTH=1","DAY_OF_YEAR-1"

The order of commands makes a difference when chaining relative actions. Dates are always evaluated first, and all actions of type are evaluated in the order they appear (i.e. all dates are evaluated in the order they appear, and then all times are evaluated in the order they appear). For example, in the chain "DATE1","TIME1","DATE2","TIME2", DATE1 and DATE2 are evaluated first. After those are processed, TIME1 and TIME2 are evaluated.

When chaining operators and constants, it is important to make sure the correct result is produced. The following example shows how the order of the operators can cause varying results, depending on the base current time.

For the following example, assume that the base current time is the first week in May, and it is a Thursday.

Example of expression order

The expression...

Produces the result...

Because...

"DAY_OF_WEEK=
$TUESDAY",
"$MONTH=$MAY"

5/29

The expression first looks for Tuesday in the current week. Since today's date is 5/1 and it is a Thursday, the Tuesday in the current week is 4/29. The expression then sets the current month to May.

"MONTH=$MAY",
"DAY_OF_WEEK=
$TUESDAY"

4/29

The expression first sets the current month to May, then finds the date of the Tuesday in the current week. Since today's date is 5/1 and it is a Thursday, the Tuesday in the current week is 4/29.

See Also

Named Times

Properties and Operators for Named Times

Value Constants for Named Times

Mixing Absolute and Relative Times

Configuring named times