In Snowflake, when converting some local dates to UTC and then back to local timezone using CONVERT_TIMEZONE function, the end result is off by one hour. For example:
ALTER SESSION SET TIMEZONE = 'Canada/Eastern';
select
cast('1949-04-24' as timestamp) as date_local -- because TIMEZONE = 'Canada/Eastern'
, convert_timezone('Canada/Eastern', 'UTC', '1949-04-24') as date_utc
, convert_timezone('UTC', 'Canada/Eastern', convert_timezone('Canada/Eastern', 'UTC', '1949-04-24')) as date_local1
The results are:
| DATE_LOCAL | DATE_UTC | DATE_LOCAL1 |
|---|---|---|
| 1949-04-24 00:00:00.0 | 1949-04-24 05:00:00.0 | 1949-04-24 01:00:00.0 |
I expect both DATE_LOCAL and DATE_LOCAL1 to be identical, however DATE_LOCAL1 is one hour off. Is this expected? Am I missing something or there is a bug in the CONVERT_TIMEZONE function?