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
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
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
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