Tags: convert, converting, epoch, exampletdate, format, helpim, programming, python, string, time, versa, vice, yyy

converting epoch time to string (and vice versa)

On Programmer » Python

1,075 words with 1 Comments; publish: Fri, 04 Jan 2008 12:53:00 GMT; (20047.00, « »)

Hi,

I have a string in this format "DD/MM/YYY" for example:

tdate = "18/01/1990"

and Im trying to convert this to epoch time, can anyone help?

Im also trying to convert that epoch time to the string format

previously. Can anyone help this one too?

Thanks!

Astan

All Comments

Leave a comment...

  • 1 Comments
    • On Mar 13, 12:42 am, Astan Chee <s....python.todaysummary.com.al.com.auwrote:
      Quote:
      === Original Words ===

      Hi,

      I have a string in this format "DD/MM/YYY" for example:

      tdate = "18/01/1990"

      and Im trying to convert this to epoch time, can anyone help?

      Im also trying to convert that epoch time to the string format

      previously. Can anyone help this one too?

      Thanks!

      Astan

      Read up on time.strftime() (_F_ormats a time to a string of various

      styles) and time.strptime() (_P_arses a string of various formats into

      a time).

      -- Paul

      #1; Fri, 04 Jan 2008 12:54:00 GMT