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

CONV_TIMESTAMP

Script function: Converts date and time for use in another time zone

Syntax

CONV_TIMESTAMP(Time Stamp, [TimeZone1], [TimeZone2])

Syntax

Description/Format

Time stamp

Time stamp from date and time ("YYYY-MM-DD HH:MM:SS").
Format: script literal or script variable

TimeZone 1

Name of a TimeZone object or keyword UTC.
The time zone assigned to a time stamp or UTC.

Format: script literal or script variable
Default: "UTC"

TimeZone 2

Name of a TimeZone object.
Time zone for which the time stamp is to be converted.

Format: script literal or script variable


Return code

Time stamp in the format ""YYYY-MM-DD HH:MM:SS"

Remarks

This script function converts date and time into the "YYYY-MM-DD HH:MM:SS" format for use in another time zone.

In doing so, TimeZone 1 may be used to enter the original time zone on which the calculation is based. If this parameter is left out, or if the keyword UTC is used, UTC (Coordinated Universal Time) is the valid basis for calculation. TimeZone 2 is used to name the time zone for which the time stamp is to be converted. If this optional parameter is not specified, the valid time zone is that of the object, or client in case no time zone has been defined for that object.

If UTC is not used as the basis for calculation, time conversion is inaccurate when converting from summertime to wintertime. For example, if 02:30:00 means the first or second occurrence of this time of day cannot be recognized. AE always assumes the first appearance of a certain time during conversion to represent wintertime.

Example

The following example shows time stamp conversion for the 2003/2004 turn of year. The conversion basis is a time zone defined for Sydney, Australia, which is converted to Central European Time. The result, "2003-12-31 14:00:00", is written to the activation protocol.

:SET &MEZ# = CONV_TIMESTAMP("2004-01-01 00:00:00","TZ.SYD","TZ.MEZ")
:
PRINT &MEZ#

 

See also:

Script element Description

CONV_DATE

Converts a date from one date format to another

Script Elements - Date and Time

Time

About Scripts
Script Elements - Alphabetical Listing
Script Elements
- Ordered By Function