Date/Time Conversion

dapmco webmaster at clasp.org
Thu Nov 7 15:42:07 EST 2002


Thanks Paul.. That worked fine. I looked at the docs but could not figure
out how to do this. A couple of routines looked like they would work but I
couldnt seem to invoke them on my Windows platform

Input a date in some format ex 01/01/1990..
Return the number of seconds between 01/01/1970 and the date entered.

Dave


"Paul Osman" <paul.osman at sympatico.ca> wrote in message
news:mailman.1036696150.11839.python-list at python.org...
> On Thu, 7 Nov 2002, dapmco wrote:
>
> > Im new to Python.. I have it installed on a win2k server. Im trying to
> > figure out how to return the date if I enter a number corresponding
> > to # of seconds since the Epoch
> >
> > Anyone know of a good site with example code??
> >
> > Dave
>
> You'll want to look at the Python Library Reference for the
> time module:
>
> http://www.python.org/doc/current/lib/module-time.html
>
> Example code:
>
> import time
> time_stamp = 1036695674
> print time.strftime("%B %d %Y", time.localtime(time_stamp))
>
> Cheers,
> --
> Paul Osman
> posman at linux.ca
> http://paul.codecipher.com
>
>





More information about the Python-list mailing list