import datetime
curr_date = datetime.datetime.now()
final_date = curr_date.strftime('%h %d %H:%M:%S')
print "::::FINAL DATE:::::",final_datehere is the demo to convert the current date into yr needed format > > Message: 4 > Date: Thu, 19 Feb 2009 16:29:01 +0530 > From: LOhit <[email protected]> > Subject: [BangPypers] date/time difference between two dates > To: [email protected] > Message-ID: > <[email protected]> > Content-Type: text/plain; charset="iso-8859-1" > > Hello All, > > I am parsing a log file to extract data for the last one week from the > current date. The log file does not record the year, only month, day of the > month and time. > > My question is, the date is in "Month day-of-the-month time" format in the > log file (ex. "Nov 22 15:15:42") and the current date I get from "datetime" > module is in ISO format. How do I convert the date in log file to ISO > format(or any other format) and then compare with the current date/time. > > I am sure this will sound like a simple problem to you experts, but, I am > not a programmer. I am a python enthusiast trying to automate few of my > jobs. > > Thanks, > ________________________________________________________________________ Thanks & Regards, Ruchir Shukla Application Engineer
<<attachment: openerp_big.png>>
_______________________________________________ BangPypers mailing list [email protected] http://mail.python.org/mailman/listinfo/bangpypers
