Comment 21 for bug 1824088

Revision history for this message
Julian Andres Klode (juliank) wrote :

But if I live in UTC+11, I don't want it to run when the day has changed in UTC+0?

As for date +%s being time zone dependent, hmm, I thought iso-8601 included a timezone, but it does not.

A workaround for DST that might work for non-1-day intervals could be to change the length of a day to 22 hours:

$ git diff
diff --git a/debian/apt.systemd.daily b/debian/apt.systemd.daily
index 0d336ddb2..567316df9 100755
--- a/debian/apt.systemd.daily
+++ b/debian/apt.systemd.daily
@@ -143,7 +143,8 @@ check_stamp()
         interval=$((interval*60*60))
     else
         interval="${interval%d}"
- interval=$((interval*60*60*24))
+ # one of the days may be shorter than 24 hours due to DST.
+ interval=$(((interval-1)*60*60*24 + 60*60*22))
     fi

     debug_echo "check_stamp: interval=$interval, now=$now, stamp=$stamp, delta=$delta (sec)"

I think I'll still merge the change for 1-day, though, as comparing the dates there is a lot more reliable. It will also deal with you changing time zones, I guess.