Re: Correcting for Drift between Two Dates

2008-09-09 Thread W. eWatson
Steven D'Aprano wrote: On Mon, 08 Sep 2008 21:53:18 -0700, W. eWatson wrote: I have two dates, ts1, ts2 as below in the sample program. I know the clock drift in seconds per day. I would like to calculate the actual date of ts2. See my question at the end of the program. When faced with a co

Re: Correcting for Drift between Two Dates

2008-09-09 Thread Steven D'Aprano
On Mon, 08 Sep 2008 21:53:18 -0700, W. eWatson wrote: > I have two dates, ts1, ts2 as below in the sample program. I know the > clock drift in seconds per day. I would like to calculate the actual > date of ts2. See my question at the end of the program. When faced with a complicated task, break

Re: Correcting for Drift between Two Dates

2008-09-08 Thread Erik Max Francis
W. eWatson wrote: drift = 4.23 # seconds per day format = '%Y%m%d_%H%M%S' ts1 = "20080901_12" # base date-time ts2 = "20080904_18" d1 = datetime(*(time.strptime(ts1, format)[0:6])) d2 = datetime(*(time.strptime(ts2, format)[0:6])) #d += timedelta(seconds=sec) delta = d2-d1 # delta for

Correcting for Drift between Two Dates

2008-09-08 Thread W. eWatson
I have two dates, ts1, ts2 as below in the sample program. I know the clock drift in seconds per day. I would like to calculate the actual date of ts2. See my question at the end of the program. # time differences with addition of drift from datetime import datetime, timedelta import time drif