-
Notifications
You must be signed in to change notification settings - Fork 378
feat!: parsing local timestamp #1352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: parsing local timestamp #1352
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1352 +/- ##
===========================================
- Coverage 85.48% 85.08% -0.41%
===========================================
Files 514 514
Lines 77414 77523 +109
===========================================
- Hits 66181 65964 -217
- Misses 11233 11559 +326 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good 👍
For existing users this can be a breaking change: the default time zoned just changed from UTC to local. We need to address this behaviour in changelog and guide them to set |
👍 Nice job, my timestamp master @v0y4g3r |
* fix: parse and display timestamp/datetime in local time zone * fix display * fix: unit tests * change time zone env * fix: remove useless code
I hereby agree to the terms of the GreptimeDB CLA
What's changed and what's your intention?
This PR changes the behavior of parsing timestamp/datetime literals without explict time zone info, according to system time zone (inherently from TZ env variable when GreptimeDB instance runs).
For example:
1970-01-01 00:00:00+0000
will be parsed to 0 in unix timestamp, since it has explicit time offset 01970-01-01 08:00:00+0800
will be parsed to 0 in unix timestamp, since it has explicit time offset+0800
1970-01-01 08:00:00
will be parsed to 0 if GreptimeDB instance is running inCST
time zone (UTC+8) and 14400 if running inAsia/Dubai
time zone (UTC+4)This PR also adds time zone identifier to
DateTime
formatted string.Checklist
Refer to a related PR or issue link (optional)
#1319