[Tutor] Dates?
Praveen Pathiyil
ppathiyi@cisco.com
Wed, 9 May 2001 19:43:56 +0530
HI,
You can try the following.
import time
time_log = time.asctime(time.localtime(time.time()))
print time_log
This will give you --->
'Wed May 9 09:46:18 2001'
Regards,
Praveen.
----- Original Message -----
From: "Ryan Booz" <ryanbooz@alumni.psu.edu>
To: <tutor@python.org>
Sent: Wednesday, May 09, 2001 6:35 PM
Subject: [Tutor] Dates?
> Hello all...
>
> I'm trying to get Python to write (in files) and examine dates and times
> in programs. Say for a logging program or to have it parse logs and
> write particular output based on dates (or even delete stuff based on
> dates).
>
> Anyway, I've tried to work with the time module some and have read
> through the "Time access and conversions" in the Python library
> reference. But I can't get any "real" dates to "appear". I can use the
> time() function and get the seconds since epoch... but not matter what I
> try to do to get a "readable" date from Python, I get the beginning of
> epoch (Dec. 31 1969). So, my question is, how do I start getting some
> real dates that I can use in my programs that are "real"?
>
> Thanks in advance...
> Ryan Booz
> Tech Coordinator
> Belleville Mennonite School
>
>
> _______________________________________________
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>