date/time

Thomas Guettler guettli at thomas-guettler.de
Wed Jan 5 10:52:22 EST 2005


Am Wed, 05 Jan 2005 15:08:37 +0100 schrieb Nader Emami:

> L.S.,
> 
> Could somebody help me how I can get the next format of date
> from the time module?

I don't understand your question. Do you want to have the next day?

20041231 --> 20050101 ?

You can do it like this:
 - parse the string with time.strptime
 - timetuple[2]+=1
 - mktime(timetuple) # --> secs
 - strftime(localtime(secs))

 HTH,
   Thomas

-- 
Thomas Güttler, http://www.thomas-guettler.de/





More information about the Python-list mailing list