[issue44413] OverflowError: mktime argument out of range after 2019
Vyacheslav
report at bugs.python.org
Sun Jun 13 14:02:13 EDT 2021
New submission from Vyacheslav <psijic at gmail.com>:
date_str = "2019-06-06 10:02:00"
datetime_obj = datetime.strptime(date_str, "%Y-%m-%d %H:%M:%S")
datetime_obj_utc1 = datetime_obj.replace(tzinfo=pytz.timezone("America/New_York"))
datetime_obj_utc2 = pytz.timezone("America/New_York").localize(datetime_obj)
print(datetime_obj_utc1, datetime_obj_utc2)
ts1 = time.mktime(datetime_obj_utc1.timetuple())
ts2 = time.mktime(datetime_obj_utc2.timetuple())
>>> Output:
ts2 = int(time.mktime(datetime_obj_utc2.timetuple()))
OverflowError: mktime argument out of range
OS: Linux OpenSuse TW
----------
messages: 395758
nosy: psijic
priority: normal
severity: normal
status: open
title: OverflowError: mktime argument out of range after 2019
type: crash
versions: Python 3.8
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44413>
_______________________________________
More information about the Python-bugs-list
mailing list