converting epoch time to string (and vice versa)

Paul McGuire ptmcg at austin.rr.com
Tue Mar 13 07:15:09 EDT 2007


On Mar 13, 12:42 am, Astan Chee <s... at al.com.au> wrote:
> 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




More information about the Python-list mailing list