Skip to main content

getTimeZone

Returns the timezone ID or offset for a datetime object.

The function returns a string showing the timezone ID (e.g 'Australia/Sydney') or offset (e.g. '+02:00').

If the input object has no timezone ID or offset, the function returns a warning.

Parameters

Examples

For simplicity, these examples use strings in an automatically recognized patterns.

ATL in Script

Result

[[getTimeZone('2018-12-12T14:00:00+01:00')]]

+01:00

[[getTimeZone('2018-12-12T14:00:00-05:00')]]

-05:00

[[getTimeZone('2018-12-12T14:00:00Z[America/Vancouver]')]]

America/Vancouver

[[getTimeZone('2018-12-12T14:00:00Z[Australia/Sydney]')]]

Australia/Sydney

[[getTimeZone('2018-12-12T14:00:00Z[Europe/London]')]]

Europe/London

[[getTimeZone('2018-12-12T14:00:00Z[Asia/Hong_Kong]')]]

Asia/Hong_Kong

[[getTimeZone('2018-12-12T14:00:00Z[Europe/Zurich]')]]

Europe/Zurich

[[getTimeZone('2018-12-12T14:00:00Z[Australia/Perth]')]]

Australia/Perth

[[getTimeZone('2018-12-12T14:00:00Z[Asia/Tokyo]')]]

Asia/Tokyo