CONV_DATE
Use the CONV_DATE script function to convert a date from one date format to another. Assign the value that the script function returns to a script variable for further processing.
Syntax
CONV_DATE ([CurrentDateFormat:] Date [, NewDateFormat])
Parameters
| Parameter | Description | Format | Default Value |
|---|---|---|---|
| Date |
Specifies the date to convert. Note: Specify the date format when you use a format other than YYMMDD or YYYYMMDD. Use a colon or semicolon to separate the date format and the date. For more information, see Date, Time and Period Formats in Scripts. |
Script literal or script variable | n.a. |
| NewDateFormat |
(Optional) Defines the format to convert the date to. Note: If you do not specify the new date format, the default format YYMMDD is used. |
Script literal or script variable | YYMMDD |
Return Codes
The CONV_DATE function returns the converted date as a string in the specified format.
Examples
In the following example, the specified date is in a different format than YYMMDD or YYYYMMDD, so the script specifies the current format. The script also specifies the new date format.
: SET &QUALIFYINGDATE# = CONV_DATE ("DDMMYY:311299", "DD.MM.YYYY")
: PRINT &QUALIFYINGDATE#
Line in the activation report:
2019-03-28 10:12:47 - U00020408 31.12.1999
In the following example, the specified date is in YYMMDD format, so the script does not need to specify the current format. The script just specifies the new date format.
: SET &QUALIFYINGDATE# = CONV_DATE ("991231", "DD-MM-YYYY")
: PRINT &QUALIFYINGDATE#
Line in the activation report:
2019-03-28 10:15:09 - U00020408 31-12-1999
In the following example, the script does not specify the new format, so the date is returned in the default YYMMDD format.
:SET &QUALIFYINGDATE# = CONV_DATE ("DDMMYY:311299")
: PRINT &QUALIFYINGDATE#
Line in the activation report:
2019-03-28 10:17:59 - U00020408 991231
Related Topics
Date, Time and Period Formats in Scripts
See also: