[issue36899] datetime utcfromtimestamp ignores astimezone

2019-05-13 Thread Piotr Kamoda
New submission from Piotr Kamoda : See below code: >>> datetime.utcfromtimestamp(1557395250).astimezone(get_localzone()).strftime('%Y-%m-%d >>> %H:%M:%S %z %Z') '2019-05-09 09:47:30 +0200 CEST' >>> datetime.fromtimestamp(1557395250).astimezone(ge

[issue36899] datetime utcfromtimestamp ignores astimezone

2019-05-13 Thread Piotr Kamoda
Piotr Kamoda added the comment: Docs state that fromtimestamp returns a naive datetime object (https://docs.python.org/3.7/library/datetime.html#datetime.datetime.fromtimestamp) and not utcfromtimestamp. Perhaps it needs fixing. Additionally, astimezone fails silently, I even tried

[issue36899] datetime utcfromtimestamp ignores astimezone

2019-05-13 Thread Piotr Kamoda
Piotr Kamoda added the comment: Ok, now I see that naive object assumes my timezone in some cases. That's still mind-boggling that utcfromtimestamp returns an object that shows utc hour but when astimezone is applied it reverts without converting the hour to local timezone. See bel