New submission from acummings <acummi...@aperiogroup.com>: On Windows, the calculation of when DST starts is incorrect. Windows OS seems to be fully patched, and correctly changed to DST on 3-8-2009. However, datetime.now() is 1 hour less then Windows displayed time.
I even tried setting the TZ environment variable to PST8PDT,M3.2.0,M11.1.0 to fully specify the date change. Below you can see that today (3-27-08) is marked as standard time, while July 1st is DST and Jan 1st is Standard, if I understand the meaning of the 9th element of the timetuple: ON WINDOWS, with windows reporting the time as 3:59pm: >>> july1 = datetime(2009, 7, 1) >>> jan1 = datetime(2009, 1, 1) >>> time.localtime(time.mktime(july1.timetuple())) (2009, 7, 1, 0, 0, 0, 2, 182, 1) >>> time.localtime(time.mktime(jan1.timetuple())) (2009, 1, 1, 0, 0, 0, 3, 1, 0) >>> time.localtime(time.mktime(datetime.now().timetuple())) (2009, 3, 27, 14, 59, 46, 4, 86, 0) It worked correctly on Linux, though: >>> july1 = datetime(2009,7,1) >>> jan1 = datetime(2009,1,1) >>> time.localtime(time.mktime(july1.timetuple())) (2009, 7, 1, 0, 0, 0, 2, 182, 1) >>> time.localtime(time.mktime(jan1.timetuple())) (2009, 1, 1, 0, 0, 0, 3, 1, 0) >>> time.localtime(time.mktime(datetime.now().timetuple())) (2009, 3, 27, 15, 57, 2, 4, 86, 1) ---------- components: Windows messages: 84286 nosy: acummings severity: normal status: open title: Incorrect DST transition on Windows versions: Python 2.5 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5582> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com