-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add localtime docs about timezones (inc. pitfalls) #182
base: main
Are you sure you want to change the base?
Conversation
c636a5e
to
7c21694
Compare
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.
Good call outs, just unsure about two examples
# only one hour elapsed for the rest of the world. | ||
localtime.as_utc(datetime(2020, 3, 29, hour=2, tzinfo=london_tz)) - | ||
localtime.as_utc(datetime(2020, 3, 29, hour=0, tzinfo=london_tz)) | ||
=> timedelta(seconds=3600) |
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.
Is this right? This is showing 1 hour
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.
The example is accurate, yes:
- 2AM GBR => 1AM UTC
- 0AM GBR => 0AM UTC
I've elaborated the comment a bit; does that help?
datetime(2020, 3, 29, hour=2, tzinfo=london_tz) - | ||
datetime(2020, 3, 29, hour=1, tzinfo=london_tz) | ||
=> datetime.timedelta(seconds=3600) # <== WRONG (should be 0) | ||
``` |
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.
This section is confusing, it's not obvious why it's wrong
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.
I've elaborated the comment a bit; does that help?
Maybe this example just isn't a good fit here. I think it's important knowledge, so I'd like to put it somewhere.
7c21694
to
6b3363f
Compare
In response to [^1]. [^1]: #178 (comment)
6b3363f
to
11a881e
Compare
In response to 1.
👉 Markdown rendered version
Footnotes
https://github.com/octoenergy/xocto/pull/178#discussion_r1875190812 ↩