Why %e not in time.strftime directives?

Tim Chase python.list at tim.thechases.com
Sat Dec 13 16:50:03 CET 2008


> Any special reasons?

Because it is there (at least on my Debian box)?

   tim at rubbish:~$ python
   Python 2.5.2 (r252:60911, May 28 2008, 08:35:32)
   [GCC 4.2.4 (Debian 4.2.4-1)] on linux2
   Type "help", "copyright", "credits" or "license" for
   more information.

   >>> import time
   >>> time.strftime('%c')
   'Sat Dec 13 09:35:03 2008'
   >>> time.strftime('%e')
   '13'

Taken from[1]

   The full set of format codes supported varies across
   platforms, because Python calls the platform C library's
   strftime() function, and platform variations are common.

So if your underlying C implementation of strftime() supports 
"%e", then Python will.  My guess is that the same applies to 
time.strftime as it does to datetime.strftime

The docs list ones that are fairly cross-platform.  However, it 
would seem that not all platforms support "%e"


-tkc


[1]
http://docs.python.org/library/datetime.html#module-datetime







More information about the Python-list mailing list