Automation Engine Script Guide > Ordered by Function > Date and Time > CONV_DATE

CONV_DATE

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

Syntax

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.
Format: script literal or script variable.


Return code

Date in the new format

Comments

This scriptA particular Automation Engine object type. functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… 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 variableA placeholder for a value within a script.. 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

CONV_TIMESTAMP

Converts date and time for use in another time zoneIt defines a local time. A particular Automation Engine object type..

Script Elements - Date and Time

Date, Time and Period Formats

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by Function

 


Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support

Copyright © 2016 Automic Software GmbH