Message28592
According to the time module documentation, if the time
argument for strftime() is not provided, it will use
the current time as returned by localtime().
However, when the value of localtime() is explicitly
given to strftime(), this produces an error in the
value of the timezone offset (%z) as seen here:
>>> from time import *
>>> strftime("%a %b %e %H:%M:%S %Y %Z %z")
'Tue May 23 16:28:31 2006 IST +0100'
>>> strftime("%a %b %e %H:%M:%S %Y %Z %z", localtime())
'Tue May 23 16:28:31 2006 IST +0000'
This same problem happens for other timezones (the
offset is always +0000 when localtime() is explicitly
given).
This problem is present in both these versions:
Python 2.4.2 (#2, Sep 30 2005, 21:19:01)
[GCC 4.0.2 20050808 (prerelease) (Ubuntu
4.0.1-4ubuntu8)] on linux2
Python 2.3.5 (#2, Sep 4 2005, 22:01:42)
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
|
|
Date |
User |
Action |
Args |
2007-08-23 14:40:09 | admin | link | issue1493676 messages |
2007-08-23 14:40:09 | admin | create | |
|