from solar import * last = None for line in open("dpu_reboot.list"): tt = str_to_datetime (line.strip()) if last: dt = tt - last print (tt, dt) else: print (tt) last = tt