CONV_DATE

Use the CONV_DATE script function to convert a date from one date format to another. For more information, see Date, Time and Period Formats in Scripts. Assign the value that the script function returns to a script variable for further processing.

Syntax

CONV_DATE ([CurrentDateFormat:] Date [, NewDateFormat])

Parameters

  • CONV_DATE
    Converts a given date to a given date format

  • Date
    Date to convert
    Format: script literal or script variable
    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.

  • NewDateFormat
    (Optional) Format to convert the date to
    Format: script literal or script variable
    Note: If you do not specify the new date format, the default format YYMMDD is used.

Examples

These examples convert a date from one date format to another, and print the result in the activation report.

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

See also: