New submission from Snidhi Sofpro <[email protected]>:
With: Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit
(Intel)] on win32
import datetime;
d_Time = datetime.datetime.strptime('03:30 PM', '%I:%M %p');
d_Time = d_Time.astimezone(datetime.timezone.utc);
# RESULTS IN OSError: [Errno 22] Invalid argument
# WHEREAS the foll. does not have the issue!
d_Time = datetime.datetime(year = d_Time.year,
month = d_Time.month,
day = d_Time.day,
hour = d_Time.hour,
minute = d_Time.minute,
second = d_Time.second,
tzinfo = datetime.timezone.utc);
print(d_Time);
----------
components: Library (Lib)
messages: 341149
nosy: Snidhi
priority: normal
severity: normal
status: open
title: datetime: astimezone() results in OSError: [Errno 22] Invalid argument
type: behavior
versions: Python 3.6
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue36759>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com