Why %e not in time.strftime directives?

Discussion in 'Python' started by Leo jay, Dec 13, 2008.

  1. Leo jay

    Leo jay Guest

    Any special reasons?

    Thanks.
     
    Leo jay, Dec 13, 2008
    #1
    1. Advertising

  2. Leo jay

    Guest

    , Dec 13, 2008
    #2
    1. Advertising

  3. Leo jay

    Tim Chase Guest

    > Any special reasons?

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

    tim@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
     
    Tim Chase, Dec 13, 2008
    #3
  4. Leo jay

    Leo Jay Guest

    On Sat, Dec 13, 2008 at 11:50 PM, Tim Chase
    <> wrote:
    >> Any special reasons?

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



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

    ''
    >>>



    > tim@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
     
    Leo Jay, Dec 14, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Allen Unueco

    time.strftime Timezone issue

    Allen Unueco, Jun 13, 2004, in forum: Python
    Replies:
    1
    Views:
    366
    Allen Unueco
    Jun 13, 2004
  2. Sheila King
    Replies:
    5
    Views:
    988
    Moderator, k12.ed.math
    Apr 22, 2005
  3. richard
    Replies:
    2
    Views:
    472
    richard
    Jan 13, 2006
  4. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,230
    Smokey Grindel
    Dec 2, 2006
  5. Greg Krohn
    Replies:
    1
    Views:
    991
    Denis Kasak
    Feb 17, 2009
Loading...

Share This Page