convert_timezone 'America/New_York' 会根据一年中的时间而不管我的时区偏移量如何吗?
Will convert_timezone 'America/New_York' work regardless of my timezone's offset depending on time of year?
我的时区是格林威治标准时间 -4 或 -5,具体取决于一年中的不同时间。目前是-4。
如果我使用下面这段代码,当我们改为-5时它会自动切换吗?
select convert_timezone('America/New_York', CAST(json_extract_path_text('{"timestamp":"2019-04-16T03:30:00.704Z"}', 'timestamp') as TIMESTAMP));
目前 return 上面的行是 2019-04-15 的日期。
但是如果我在 12 月打这个电话(注意时间有 +1 小时),
它仍然是 return 2019-04-15 的日期吗?
select convert_timezone('America/New_York', CAST(json_extract_path_text('{"timestamp":"2019-04-16T04:30:00.704Z"}', 'timestamp') as TIMESTAMP));
也就是说,它会在没有干预的情况下在EDT和EST之间切换吗?或者有更好的方法吗?
谢谢
考虑:
2019-04-16T03:30:00.704Z
(UTC) 在 America/New_York
中是 2019-04-15T23:30:00.704-04:00
2019-04-16T04:30:00.704Z
(UTC) 在 America/New_York
中是 2019-04-16T00:30:00.704-04:00
2019-12-16T04:30:00.704Z
(UTC) 在 America/New_York
中是 2019-12-15T23:30:00.704-05:00
对于美国东部时间,4 月的日期为 -4,而 12 月的日期为 -5。换句话说,被转换的时间戳决定了应用哪个偏移量。
代码执行的日期和时间没有相关性.
我的时区是格林威治标准时间 -4 或 -5,具体取决于一年中的不同时间。目前是-4。
如果我使用下面这段代码,当我们改为-5时它会自动切换吗?
select convert_timezone('America/New_York', CAST(json_extract_path_text('{"timestamp":"2019-04-16T03:30:00.704Z"}', 'timestamp') as TIMESTAMP));
目前 return 上面的行是 2019-04-15 的日期。
但是如果我在 12 月打这个电话(注意时间有 +1 小时), 它仍然是 return 2019-04-15 的日期吗?
select convert_timezone('America/New_York', CAST(json_extract_path_text('{"timestamp":"2019-04-16T04:30:00.704Z"}', 'timestamp') as TIMESTAMP));
也就是说,它会在没有干预的情况下在EDT和EST之间切换吗?或者有更好的方法吗?
谢谢
考虑:
2019-04-16T03:30:00.704Z
(UTC) 在America/New_York
中是2019-04-15T23:30:00.704-04:00
2019-04-16T04:30:00.704Z
(UTC) 在America/New_York
中是2019-04-16T00:30:00.704-04:00
2019-12-16T04:30:00.704Z
(UTC) 在America/New_York
中是2019-12-15T23:30:00.704-05:00
对于美国东部时间,4 月的日期为 -4,而 12 月的日期为 -5。换句话说,被转换的时间戳决定了应用哪个偏移量。
代码执行的日期和时间没有相关性.