date

Syntax date (value)

Params value is the object whose datatype you wish to coerce to be a date.

Action Coerces the datatype of value to be 'date' if possible.

Returns A date value

Examples date (180)

   » 1/1/4 ; 12:03 AM

The time at 180 seconds (3 minutes) after midnight, January 1, 1904.

date (2767729543)

   » 9/14/91 ; 9:45 PM

There are 2,767,729, 543 seconds between midnight, Jan. 1, 1904, and 9:45 p.m. on September 14, 1991.

date ("4/20/91")

   » 4/20/91 ; 12:00 AM

See Notes for a discussion of valid string formats for the date verb.

date ("Apr 26, 1991")

   » 4/26/91 ; 12:00 AM

See Notes for a discussion of valid string formats for the date verb.

date ("April 20, 1991 8:15 PM")

   » 4/20/91 ; 8:15 PM

See Notes for a discussion of valid string formats for the date verb and the inclusion of a time in the string.

Errors An attempt to coerce an inappropriate datatype (for example, a value that can't be coerced to a number) to a date will produce an error message.

Notes The appearance of the return value in the examples is the result of Frontier's coercing the date value to a string for display.

The format in which date values are displayed, as well as the permissible format of strings being passed to this verb for coercion, is system dependent.

You can supply a string as the value in any of the following formats:

Numbers separated by slashes or dashes, in the order in use by the system (e.g., "4/20/91" or "20/4/91" or "4-20-91" or "20-4-91")

Standard abbreviations for the month, with or without punctuation (e.g., "April 20, 1991" or "Apr 20, 1991" or "Apr 20 1991").

The full month, day and year (e.g., "April 20, 1991").

Any string containing a date in a valid format as explained in the previous note can optionally include a time in 24-hour format or in 12-hour format. If the 12-hour format is used, the time must be followed by "PM." The use of "AM" is, of course,

optional, since 12-hour and 24-hour times are identical for AM settings. (If you insert periods after the "P" and/or the "M" in the string argument, Frontier ignores the attempt to create a PM time and treats the string as if an AM time were intended.)

See Also Clock Verbs

Date Verbs

Discuss