[issue15942] Time representation for Windows incorrect when BIOS clock set to localtime when calling time.localtime()

Garrett Cooper report at bugs.python.org
Thu Sep 13 21:02:47 CEST 2012


New submission from Garrett Cooper:

Windows doesn't return sane values for localtime(3) (per POSIX [1]) when
the BIOS is set to the local time (the host is a Win2k8-R2 machine):

$ python -V; python -c 'import time; print time.strftime("%m-%d-%y %H:%M:%S", time.localtime())'; date; uname -a
Python 2.6.1
09-13-12 19:56:03
Thu, Sep 13, 2012 11:56:03 AM
CYGWIN_NT-6.1-WOW64 QAQA-ORPTO8B466 1.7.11(0.260/5/3) 2012-02-24 14:05 i686 Cygwin

This seems to be a conscious design choice on Microsoft's part:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724961%28v=vs.85%29.aspx

I'll try and follow this up with the POSIX folks or maybe Microsoft, but
for the time being this needs to be documentation as an issue with downstream consumers (perl 5.8.9 also illustrates this issue).

----------
components: Library (Lib)
messages: 170453
nosy: yaneurabeya
priority: normal
severity: normal
status: open
title: Time representation for Windows incorrect when BIOS clock set to localtime when calling time.localtime()
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15942>
_______________________________________


More information about the Python-bugs-list mailing list