Author Snidhi
Recipients Snidhi
Date 2019-04-30.11:36:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1556624186.01.0.847614978011.issue36759@roundup.psfhosted.org>
In-reply-to
Content
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);
History
Date User Action Args
2019-04-30 11:36:26Snidhisetrecipients: + Snidhi
2019-04-30 11:36:26Snidhisetmessageid: <1556624186.01.0.847614978011.issue36759@roundup.psfhosted.org>
2019-04-30 11:36:25Snidhilinkissue36759 messages
2019-04-30 11:36:25Snidhicreate