This content describes Snap 11. For Snap 10, the equivalent page will be in Snap 10 help

Next Topic

Book Contents

Book Index

Time operators

Time Operators are used to perform calculations on either two times or one time and a number (quantity).

Table of time operators for use with time expressions

Operator

 

Description

+

Plus

The first argument is a time and the second is a quantity (a number of seconds), the result is a time representing the number of seconds added onto the time given by the first argument. For example Q1b + 3600 gives the time one hour after Q1b.

-

Minus

Where the first argument is a time and the second is a quantity (a number of seconds) the result is a time, representing the number of seconds subtracted from the time. For example Q1b - 3600 gives the time an hour before the time in Q1b.

Where both arguments are times the result is a quantity representing the number of seconds between the two times. For example Departuretime - Arrivaltime is an expression which gives the duration of stay in seconds.

WinHelp: LightSubtracting between two times that fall either side of midnight will produce a positive time difference, e.g. 3.30am minus 11.58pm results in a difference of 12720 seconds (3 hours 32 minutes) whereas 11.58pm minus 3.30am is 20h28m

See the information on Question Time Variable for a quick reference list of the number of seconds in different time periods.

See Also

Time Functions