time.strftime()

Tim Peters tim.one at comcast.net
Mon Mar 10 10:01:17 EST 2003


[jsaul]
>>>>time.strftime("%a, %d %b %Y %H:%M:%S %z", time.localtime())
>>>
> 'Mon, 10 Mar 2003 10:26:51 +0000'
>
> It should be '+0100' because this is CET time zone:
>
>>>time.strftime("%Z",time.localtime())
>>>
> 'CET'

[Carsten Gaebler]>
> Same on my system. But 'date +%z' works fine, so it doesn't seem to be a
> library issue but a python bug.

Doubt it -- take a look at time_srftime() in Python's timemodule.c.  It's
just a wrapper around the platform strftime(), and returns whatever the
latter returns.






More information about the Python-list mailing list