CONV_TIMESTAMP

Use the CONV_TIMESTAMP script function to convert a date and time to a different time zone. For more information, see Time Zone (TZ).

Syntax

CONV_TIMESTAMP (Timestamp, [TimeZone1] [, TimeZone2])

Parameters

Parameter Description Format Default Value
Timestamp Specifies the timestamp from date and time in YYYY-MM-DD HH:MM:SS format. Script literal or script variable n.a.
TimeZone1 (Optional) Defines the original time zone on which the calculation should be based. Assigned as the name of a TimeZone object or the keyword UTC. Script literal or script variable UTC
TimeZone2 (Optional) Defines the TimeZone object name for which the timestamp is to be converted. Script literal or script variable The time zone defined for the object. If the object does not include a time zone definition, the time zone of the client is used.

Important Considerations

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. For 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, and will read it as its first occurrence. For details, see Daylight Saving and Standard Time Changes.

Return Codes

The CONV_TIMESTAMP function returns the timestamp in the YYYY-MM-DD HH:MM:SS format.

Examples

The following example converts the timestamp for the turn of the year 2017/2018 using two Time Zone objects: one for Sydney, Austria (TZ.SYD), and another for Central European time (TZ.CET).

: SET &CET# = CONV_TIMESTAMP ("2018-01-01 00:00:00""TZ.SYD""TZ.CET")

: PRINT &CET#

Line in the activation report:

2019-03-28 10:17:59 - U00020408 2017-12-31 14:00:00

See also: