This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: time.strftime fails to use %:z time formatter of the underlying C library
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: deronnax, vstinner
Priority: normal Keywords:

Created on 2013-11-14 14:51 by deronnax, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg202845 - (view) Author: Mathieu Dupuy (deronnax) * Date: 2013-11-14 14:51
function time.strftime fails to use '%:z' time formatter of the underlying library. Passing it does not format time accordingly but returns it as if it was a non-formatting string.

Simple reproduction, on Linux:
$ date +%:z
+01:00
$ python -c 'import time;print time.strftime("%:z")'
%:z

%z works fine, any of the other middle-colon variant (glibc also have %::z, %:::z) have the same problem.

Reproduced with python 2.7 and 3.3
msg202847 - (view) Author: Mathieu Dupuy (deronnax) * Date: 2013-11-14 15:17
But in fact "date" was not the right reference to look at, C strftime has exactly the same behaviour than python, so I'm marking this bug as invalid and closing it.
msg202848 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013-11-14 15:17
According to Mathieu on IRC, it's not a bug: date behaves differently than the C function strftime().
History
Date User Action Args
2022-04-11 14:57:53adminsetgithub: 63782
2013-11-14 15:17:51vstinnersetnosy: + vstinner
messages: + msg202848
2013-11-14 15:17:49deronnaxsetstatus: open -> closed
resolution: not a bug
messages: + msg202847
2013-11-14 14:51:55deronnaxcreate