strftime weirdness

Graham Ashton gashton at cmedltd.com
Wed Apr 17 09:18:23 EDT 2002


I clearly don't understand timezones. Can somebody please explain why I
get +0000 for both these time tuples, with the first two calls to
strftime() ?

>>> p
(1970, 1, 1, 0, 0, 0, 3, 1, 0)
>>> q
(1970, 1, 1, 0, 0, 0, 3, 1, 1)
>>> time.strftime("%d %b %Y %H:%M:%S %z", p)
'01 Jan 1970 00:00:00 +0000'
>>> time.strftime("%d %b %Y %H:%M:%S %z", q)
'01 Jan 1970 00:00:00 +0000'
>>> time.strftime("%d %b %Y %H:%M:%S %Z", q)
'01 Jan 1970 00:00:00 BST'
>>> time.strftime("%d %b %Y %H:%M:%S %Z", p)
'01 Jan 1970 00:00:00 GMT'

-- 
Graham Ashton






More information about the Python-list mailing list