DATE
Syntax
DATE(date_string [, format])
Parameters
date_string
A text representing a valid date.
format
One of the keywords in the table under "Valid Format Keywords," specifying the date format of date_string.
Description
DATE converts a date string into a Julian date (the number of days elapsed since January 1, 0000). Virtually any date format is supported via the optional format keyword, which specifies how the date is represented. If no format keyword is supplied, the default of DELIM_M_D_Y is used.
Date formats are either fixed-width (for example, the date February 28, 1970 is represented as 02281970 in MMDDYYYY format), or delimited (for example, February 28, 1970, 2-28-1970, or 02/28/1970). All of the previous examples are variants of DELIM_M_D_YY format.
In delimited formats, delimiters are slash (/), dash(-), space ( ), comma (,), or colon (:); years can be represented by either 2 or 4 digits; and months can be fully spelled out (for example, February), abbreviated (for example, Feb), or numeric (for example, 2 or 02).
For all years specified as two-digits:
*
*
This macro is available in IBM® Unica® Interact.
Examples
DATE("8/31/2000") returns the number 730729.
Valid Format Keywords
Related Functions