#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Austin, Texas
    Posts
    40
    Rep Power
    13

    how to turn mm-dd-yyyy into a timestamp?


    What is the most elegant way to turn a value of mm-dd-yyyy into a timestamp? time.mktime() is stubborn about needing a 9 item tuple.

    Would making a 9 time tuple from my value be the best way or is there a better way to go about it?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    394
    Rep Power
    51
    Hi!

    Maybe something like this:
    Code:
    timestamp = time.mktime(time.strptime("07-12-2005", "%m-%d-%Y))
    Regards, mawe
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2004
    Location
    There where the rabbits jump
    Posts
    556
    Rep Power
    11
    or just use asctime()
    Those people who think they know everything are a great annoyance to those of us who do.

IMN logo majestic logo threadwatch logo seochat tools logo