strftime in python 2.2

Discussion in 'Python' started by Flyzone, Aug 13, 2007.

  1. Flyzone

    Flyzone Guest

    I'm trying to make work this code in python 2.2.3:

    check=datetime.datetime.today().strftime("%H%M")

    but datetime is not supported in that version but just in the later.
    I can't upgrade python, too many dependencies in a critical system.
    How can i convert that string to have the same result?

    Hope someone can help me,
    Thanks in advance
     
    Flyzone, Aug 13, 2007
    #1
    1. Advertising

  2. Flyzone

    Martin Blume Guest

    "Flyzone"schrieb
    > I'm trying to make work this code in python 2.2.3:
    >
    > check=datetime.datetime.today().strftime("%H%M")
    >
    > but datetime is not supported in that version but
    > just in the later. I can't upgrade python, too many
    > dependencies in a critical system.
    > How can i convert that string to have the same result?
    >


    import time
    time.strftime("%H%M)

    HTH
    Martin
     
    Martin Blume, Aug 13, 2007
    #2
    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. Bryan O'Malley

    strftime not working as expected

    Bryan O'Malley, Feb 3, 2004, in forum: C++
    Replies:
    8
    Views:
    2,651
    Jerry Coffin
    Feb 17, 2004
  2. Bimal
    Replies:
    1
    Views:
    484
    Tim Prince
    Aug 20, 2003
  3. Richard Shea

    strftime - %a is always Monday ?

    Richard Shea, Dec 29, 2003, in forum: Python
    Replies:
    5
    Views:
    1,081
    Richard Shea
    Dec 30, 2003
  4. Allen Unueco

    time.strftime Timezone issue

    Allen Unueco, Jun 13, 2004, in forum: Python
    Replies:
    1
    Views:
    366
    Allen Unueco
    Jun 13, 2004
  5. Tim Peters

    RE: time.strftime Timezone issue

    Tim Peters, Jun 13, 2004, in forum: Python
    Replies:
    1
    Views:
    776
    Allen Unueco
    Jun 13, 2004
Loading...

Share This Page