Date-Time Literals

A literal is a value defined within the Logic Template for use as function arguments, or within an expression. Three kinds of literals are supported: numeric literals, text string literals, and date-time literals.

A date-time literal is a recognizable date, time, date-time constant, or a time duration value -- enclosed within a pair of quotation marks.

Date-Time Literal

Type

"4:05 pm"

actual time

"July 4, 2003"

actual date

"4:00 pm July 4, 2003"

actual date and time

"1 day"

a time duration

A large number of date and time formats are recognized. Some of the recognizable formats for date constants are:

Date Literals

 

 

 

"January 5, 2003"

"Jan 5, 2003"

"20030105"

"030105"

"01/05/2003"

"01/05/03"

"1/5/2003"

"1/5/03"

"01-05-2003"

"01-05-03"

"1-5-2003"

"1-5-03"

"5 January 2003"

"5 Jan 2003"

 

 

"05/01/2003"

"05/01/03"

"5/1/2003"

"5/1/03"

"05-01-2003"

"05-01-03"

"5-1-2003"

"5-1-03"

A large number of date and time formats are recognized. Some of the recognizable formats for time constants are:

Time Literals

 

 

 

"4:05:30 PM"

"4:05:30 pm"

"4:05 PM"

"4:05 pm"

"16:05:30"

"16:05"

"160530"

"1605"

Any recognized format for a date constant can be combined with any recognized format for a time constant to produce a date-time constant. The date constant can either precede or follow the time constant. The only exception is the numeric format in which the date must always precede the time literal with a blank seperating them.

Date-Time Literals

 

"20030105 160530"

numeric format

"20030105 1605"

numeric format

"030105 1605"

numeric format

"January 5, 2003 4:05 pm"

"05 Jan 2003 4:05 pm"

"4:05 pm January 5, 2003"

"4:05 pm 05 Jan 2003"

"4:05:30 PM 01/05/2003"

"05-01-03 16:05"

A time duration value is a numeric value coupled with a time duration unit. For constructing a time duration value, a limited number of time duration units are recognized.

Time Durations

 

 

 

"minute"

"min"

"minutes"

"mins"

"hour"

"hr"

"hours"

"hrs"

"day"

"da"

"days"

"das"

"month"

"mo"

"months"

"mos"

"year"

"yr"

"years"

"yrs"