Convert from/to struct_time

Discussion in 'Python' started by Florian Lindner, Apr 22, 2007.

  1. Hello,
    I have a struct_time and a datetime object and need compare them. Is there
    any function that converts either of these two to another?

    Thanks,

    Florian
    Florian Lindner, Apr 22, 2007
    #1
    1. Advertising

  2. Florian Lindner schrieb:
    > Hello,
    > I have a struct_time and a datetime object and need compare them. Is there
    > any function that converts either of these two to another?



    datetime.datetime(*time.localtime()[:6])

    Diez
    Diez B. Roggisch, Apr 22, 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. Andreas Klemt
    Replies:
    1
    Views:
    387
    Karl Seguin
    Jul 23, 2003
  2. Jaap
    Replies:
    4
    Views:
    704
    John O'Conner
    Jul 10, 2006
  3. Klaus Neuner
    Replies:
    7
    Views:
    485
    Klaus Neuner
    Jul 26, 2004
  4. sck10
    Replies:
    4
    Views:
    15,998
    daniel
    Sep 3, 2006
  5. Ulrich Eckhardt

    modifying a time.struct_time

    Ulrich Eckhardt, Dec 16, 2011, in forum: Python
    Replies:
    8
    Views:
    964
    Chris Angelico
    Dec 24, 2011
Loading...

Share This Page