Index

Date

A Gregorian date and time (UTC).

Input Format:

DD-MMM-YYYY:HH:MM:SS.ss

Where DD is the day of the month (1..31), MMM is a 3-letter month name, YYYY is a year like 1998, HH is the hour of the day, MM is the number of minutes into the hour, SS is the number of seconds into the minute, and ss is a fraction of a second. Trailing time components can be omitted, and the : colon separating the year component from the hour component can be replaced with a space.

Binary Operators:
D + T
Add a time interval to a date and time.
D - T
Subtract a time interval from a date and time.

Where D is a date and time in the form of a Date expression and T is a time interval in the form of a Interval expression.

Use with do-loops:
When a Date variable is used as the dependent variable of a do-loop, the associated loop increment is specified as a Interval constant.

Examples:
 if($date >= 25-DEC-1998 12:00 && $date <= 25-DEC-1998 2:00) {
   print "Its time for Christmas dinner!\n"
 }

 print $today

 Date day = $today
 foreach(Interval t) {0h, 6h, 12h, 18h, 24h} {
   until $date > $day + $t
   print "Another quarter of a day has passed.\n"
 }
 print "The day has passed.\n"

Context:
Variables of type Date are returned by the today() and tomorrow() functions.

Martin Shepherd (24-Oct-1999)