On Sep 22, 2:37 am, Konstantinos Pachopoulos <[EMAIL PROTECTED]>
wrote:
> Hi,
> does any body now any such algorith? to find difference in days from
> YYYYMMDD to YYYYMMDD?
> Or just an algorithm, that converts YYYYMMDD to seconds since the epoch?
>
> Thanks

For some reason, to-seconds-since-epoch is in the calendar class.
calendar.timegm() takes a tuple and returns the epoch seconds
import time
import calendar

today_secs = calendar.timegm( (2007, 9, 22, 0, 0, 0) )
print today_secs
one_day = 24*60*60
print time.gmtime( today_secs+one_day )

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to