- Notifications
You must be signed in to change notification settings - Fork5.7k
Add tz kwarg to from_timestamp()#1621
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
plammens commentedNov 18, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
With this the default is an aware python-telegram-bot/telegram/message.py Line 355 in9344944
data['date'] = from_timestamp(data['date']).replace(tzinfo=None) . Or the default forfrom_timestamp could be kept as naive UTC to avoid the breaking change.Otherwise I think the only problem is handling iftzinfoisnotNone:returndtm.datetime.fromtimestamp(unixtime,tz=tzinfo)else:returndtm.datetime.utcfromtimestamp(unixtime) |
Good point. Let's wait, what tsoam says.
Oh, shuh, you're absolutely right. Will update tonight. |
Updated as suggested. About the failing tests:
|
agree with the 2.7 part |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
@plammens Lost in translation … Thanks for clarifying! |
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.
one minor comment on a docstring. but LGTM, you can merge.
Uh oh!
There was an error while loading.Please reload this page.
actually, i just fixed the docstring myself. you can merge from master and then you can merge this PR. |
# Conflicts:#tests/conftest.py
Closing#1613 as addendum to#1506
@tsnoam@plammens Is this, what was missing or am I overlooking half of it? :D