Script function: Converts date and time for use in another time zone
CONV_TIMESTAMP(Time Stamp, [TimeZone1], [TimeZone2])
Syntax |
Description/Format |
---|---|
Time stamp |
Time stamp from date and time ("YYYY-MM-DD HH:MM:SS"). |
TimeZone 1 |
Name of a TimeZone object or keyword UTC. Format: script literal or script variable |
TimeZone 2 |
Name of a TimeZone object. Format: script literal or script variable |
Return code |
---|
Time stamp in the format ""YYYY-MM-DD HH:MM:SS" |
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.
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 |
---|---|
Converts a date from one date format to another |
Script Elements - Date and Time
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered By Function