CONV_DATE

Script Function: Converts a date from one date format to another.

Syntax

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

Syntax

Description/Format

OldDateFormat

Old Format for the specified Date.
Format: script literal or script variable

Date

Date in YYMMDD or YYYYMMDD format

Format: script literal or script variable

(Optional) You can specify a different date format: enter the desired date format, a separator (: or ;) and the date.

NewDateFormat

New Format for the specified Date.

Format: script literal or script variable


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.

Examples

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:

seealso

Script Date and Time Functions

Date, Time and Period Formats in Scripts