[Tutor] %T as a strftime format identifier

Terry Carroll carroll at tjc.com
Sat Nov 27 19:57:52 CET 2010


On Sat, 27 Nov 2010, Steven D'Aprano wrote:

> [steve at sylar ~]$ python2.5
> Python 2.5 (r25:51908, Nov  6 2007, 16:54:01)
> [GCC 4.1.2 20070925 (Red Hat 4.1.2-27)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import time
>>>> time.strftime("%T")
> '19:03:16'

Interesting.  On my Windows systems (Windows 7 and Vista, both Activestate 
Python 2.6.4.8) I get:

>>> import time
>>> time.strftime("%T")
''
>>>

On Linux (Ubuntu 10.04 and 10.10, Python 2.6.5) I get:

>>> import time
>>> time.strftime("%T")
'10:54:54'
>>>

It may be an Activestate thing, hewing closely to the docs.


More information about the Tutor mailing list