DATE_FORMAT macro
The DATE_FORMAT
macro
is available in Unica Campaign and Unica Interact.
Syntax
DATE_FORMAT(date_string, input_format,
output_format)
Parameters
date_string
A text representing a valid date.
input_format
One
of the keywords in the table below specifying the date format of date_string
.
output_format
One of the keywords in the table below specifying the wanted output date format.
Description
DATE_FORMAT()
transforms a date of input_format
to another format output_format
.
If the date is fixed-width, it must be set to one of the following values:
- DDMMYY[YY]
- DDMMMYY[YY]
- MMDDYY[YY]
- MMMDDYY[YY]
- YY[YY]MMDD
- YY[YY]MMMDD
MM is a 2-digit month and MMM is the 3-character month abbreviation.
If the date is delimited (any delimiter can be used including SPACE, DASH, SLASH), it must be set to one of these values:
- DELIM_D_M_Y
- DELIM_M_D_Y
- DELIM_Y_M_D
Examples
DATE_FORMAT("012171",
MMDDYY,
MMDDYYYY)
returns the string "01211971".
Related Functions
Function | Description |
---|---|
DATE |
Converts a date string to a Julian date. |
DATE_JULIAN |
Returns the Julian date of the input. |
DATE_STRING |
Returns the date string of the Julian date. |