Issue 1396030: TimedRotatingFileHandler at midnight rolls over at 01:00 (original) (raw)

Using TimedRotatingFileHandler with interval set to midnight rolls the log over at 1:00am rather than midnight. (LocalTime = GMT).

This is because the calculation of seconds until midnight is incorrect (it behaves as if there are 24 hours, 59 minutes and 59 seconds in the day).

It also means that should a program stop between midnight and 1:00am and restart it fails to roll over the log as the log over time is set to 1:00am the next day.

Occurs on Linux (FC3), Windows XP (SP2).

Bug occurs (2.4.2 and currently exists in most recent 2.5 SVN code).