Why %e not in time.strftime directives?

Leo Jay python.leojay at gmail.com
Sun Dec 14 01:52:34 EST 2008


On Sat, Dec 13, 2008 at 11:50 PM, Tim Chase
<python.list at tim.thechases.com> wrote:
>> Any special reasons?
>
> Because it is there (at least on my Debian box)?
>


But not on windows :(
>>> import time
>>> time.strftime("%e")
''
>>>


>  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
>
>


-- 
Best Regards,
Leo Jay



More information about the Python-list mailing list