[Tutor] %T as a strftime format identifier
Terry Carroll
carroll at tjc.com
Sat Nov 27 02:51:17 CET 2010
Was %T ever a valid format specifier for time.strftime in Python?
I just installed a Python streaming MP3 server called Edna
(http://edna.sourceforge.net/). It was an easy install except that I got
a ValueError on one line, essentially for:
time.strftime("%a, %d %b %Y %T GMT")
After a few seconds experimentation, I found that "%T" is not recognized,
but that in ANSI C strftime, it's a shorthand for %H:%M:%S. I changed it
to:
time.strftime("%a, %d %b %Y %H:%M:%S PST")
and it worked fine.
My question: was %T ever a valid format specifier in Python? My best
guess is that it was when Edna was written (the most current release is
from 2006, and the docs say it needs at least Python 1.5.2, which gives
you an example of its age). It seems odd that the format identifier would
be dropped if it had existed, though; that seems like a needless
upward compatibility issue.
I got this working, so this is mere curiosity; anyone know?
More information about the Tutor
mailing list