CONV_TIMESTAMP
Use the CONV_TIMESTAMP script function to convert date and time to a different time zone by using the format YYYY-MM-DD HH:MM:SS. For more information, see Time Zone (TZ).
Syntax
CONV_TIMESTAMP (Timestamp,[TimeZone1][,TimeZone2])
Parameters
-
CONV_TIMESTAMP
Converts date and time for use in another time zone -
Timestamp
Timestamp from date and time in YYYY-MM-DD HH:MM:SS format
Format: script literal or script variable -
TimeZone1
(Optional) Name of a TimeZone object or keyword UTC.
The time zone assigned to a timestamp or UTC. It defines the original time zone on which the calculation should be based.
Format: script literal or script variable
Default: UTC -
TimeZone2
(Optional) Name of a TimeZone object.
Time zone for which the timestamp is to be converted.
Format: script literal or script variable
Default: The time zone that is defined for the object. If the object does not include a time zone definition, the time zone of the client is used.
Return code
The script function returns the timestamp in the format YYYY-MM-DD
HH:MM:SS.
Important! If you do not use UTC as the basis for calculation, conversion results are imprecise when you change from Daylight Savings Time to Standard Time. Example: The system cannot identify whether the time 02:30:00 refers to its first occurrence in Daylight Savings Time or to its second occurrence in Standard Time. Therefore, the reads it as its first occurrence. For details, see Daylight Saving and Standard Time Changes.
Example
The following example converts the timestamp for the turn of the year 2017/2018. TimeZone1 sets the time zone that is defined for Sydney, Australia (TZ.SYD). This time zone should be converted to Central European Time which is set with TimeZone2 (TZ.CET). The result, 2017-12-31 14:00:00, is written to the activation report.
:SET &CET# = CONV_TIMESTAMP("2018-01-01 00:00:00","TZ.SYD","TZ.CET")
:PRINT &CET#
See also: