In the attachments is a better version with tests that also addresses your latest critique. On 13/08/2023 14.44, Ihor Radchenko wrote: > Ihor Radchenko writes: > >>> (while (or (= nshift 0) >>> - (not (time-less-p nil time))) >>> + (not (time-less-p nil (time-add time-to-extend time)))) >> >> And this compares "now" with year 1970. Will always return nil. > > Hmm. I somehow missed `time-add'. > However, this is still fishy. > What if we have something like <2023-08-13 2:00 ++8h>? > `org-extend-today-until' should probably be ignored then.