3 ms·
No? Or not necessarily, at least. For example, pytz (a Python timezone library) offers "is_dst" flags for exactly that purpose. >>> loc_dt = datetime(2002, 1
by Qwertystop 8y ago
No? Or not necessarily, at least. For example, pytz (a Python timezone library) offers "is_dst" flags for exactly that purpose.
>>> loc_dt = datetime(2002, 10, 27, 1, 30, 00)
>>> est_dt = eastern.localize(loc_dt, is_dst=True)
>>> edt_dt = eastern.localize(loc_dt, is_dst=False)
>>> print(est_dt.strftime(fmt) + ' / ' + edt_dt.strftime(fmt))
2002-10-27 01:30:00 EDT-0400 / 2002-10-27 01:30:00 EST-0500
https://pythonhosted.org/pytz/#problems-with-localtime https://pythonhosted.org/pytz/#problems-with-localtime
- kpmah 8y agoYeah, I think I'm confusing storing things as UTC with storing things as UTC+0 - I forgot it stores the offset.