Script Function: Converts a date from one date format to another.
CONV_DATE(Date, [NewDateFormat])
Syntax |
Description/Format |
---|---|
Date |
Indication of a date in the format "YYMMDD" or "YYYYMMDD". Format: script literal or script variable It is also possible to specify a different date format. Do so by entering the required date format, then enter a separator (: or ;) and afterwards the date. Indicating a date format is optional. |
NewDateFormat |
New Format for the specified Date. |
Return code |
---|
Date in the new format |
This script function converts the date format from Date to NewDateFormat.
The old and new date formats are optional parameters. They may be used to specify a particular format to be kept or required.
If you decide not to use the old date format, the date must either be specified in the format "YYMMDD" or "YYYYMMDD". If NewDateFormat has not been used, the default format "YYMMDD" will be returned. Use a colon or semi colon as a separator between the old date format and Date.
In the example shown below, a date is converted from one date format to another. The returned value is stored in a script variable. OldDateFormat and NewDateFormat are not specified. The returned values are "31.12.1999", "31-12-1999" and "991231".
:SET &QUALIFYINGDATE# = CONV_DATE("DDMMYY:311299", "DD.MM.YYYY")
:SET &QUALIFYINGDATE# =
CONV_DATE("991231", "DD-MM-YYYY")
:SET &QUALIFYINGDATE# =
CONV_DATE("DDMMYY:311299")
See also:
Script element | Description |
---|---|
Converts date and time for use in another time zone. |
Script Elements - Date and Time
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by Function