-
Notifications
You must be signed in to change notification settings - Fork 613
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(expr):
AT TIME ZONE
to convert between timestamp
and `timest…
…amptz` (#5968) * parse AT TIME ZONE * expr: AtTimeZone * time zone parsing and conversion * unit tests * e2e tests * comments * parse_time_zone -> lookup_time_zone Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
6cdabc6
commit 759b374
Showing
13 changed files
with
318 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# zone-independent instant -> local naive time | ||
query T | ||
select '2022-01-01 00:00:00Z'::timestamp with time zone AT TIME ZONE 'US/Pacific'; | ||
---- | ||
2021-12-31 16:00:00 | ||
|
||
# local naive time -> zone-independent instant | ||
query T | ||
select '2021-12-31 16:00:00'::timestamp AT TIME ZONE 'us/pacific'; | ||
---- | ||
2022-01-01 00:00:00+00:00 | ||
|
||
# Unlike PostgreSQL, we do not support invalid local time during daylight saving forward yet. | ||
statement error | ||
select '2022-03-13 02:00:00'::timestamp AT TIME ZONE 'us/pacific'; | ||
|
||
# Like PostgreSQL, ambiguous local time during daylight saving backward are interpreted as after the transition. | ||
query T | ||
select '2022-11-06 01:00:00'::timestamp AT TIME ZONE 'us/pacific'; | ||
---- | ||
2022-11-06 09:00:00+00:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.