AT TIME ZONE

Description

Converts an inputdate to the corresponding datetimeoffset value in the target time zone. (AT TIME ZONE in Transact-SQLarrow-up-right).

Sample Source Pattern

Syntax

inputdate AT TIME ZONE timezone

Examples

SELECT CAST('2022-11-24 11:00:45.2000000 +00:00' as datetimeoffset) at time zone 'Alaskan Standard Time';

Result:

                          DATE|
------------------------------+
2022-11-24 02:00:45.200 -09:00|

Code:

SELECT current_timestamp at time zone 'Central America Standard Time';

Result:

                          DATE|
------------------------------+
2022-10-10 10:55:50.090 -06:00|

Known Issues

  1. Snowflake does not support all the time zones that SQL Server does. You can check the supported time zones at this linkarrow-up-right.

Result:

Last updated

Was this helpful?