Kathryn M Kowalski added the comment: I did not put suggested code in - walking through it and counting days on my fingers I don't think it works.
If the desired rollover day is Tuesday (self.dayOfWeek = 1) and today is Tuesday (day = 1) then self.rolloverAt is the seconds to midnight as if daysToWait =0, and it rolls over at midnight Tuesday. However if the desired rollover day is Tuesday (self.dayOfWeek = 1) and today is Monday (day = 0) then daysToWait = 0 again. It rolls over on Monday at midnight - not Tuesday at midnight. If the desired rollover day is Tuesday (self.dayOfWeek = 1) and today is Wednesday (day = 2) then daysToWait = 5. It also rolls over on Monday at midnight - not Tuesday at midnight. Changing it to: day = t[6] # 0 is Monday if day != self.dayOfWeek: if day < self.dayOfWeek: daysToWait = self.dayOfWeek - day else: daysToWait = 6 - day + self.dayOfWeek + 1 would make it equivalent to what I have running and appears to work. (Always rolls (ends) on day specified at midnight.) Alternatively, if you wanted to change it so the log starts on the day specified you could just get rid of "if day != self.dayOfWeek:" from your code. if when.startswith('W'): day = t[6] # 0 is Monday if day < self.dayOfWeek: daysToWait = self.dayOfWeek - day - 1 else: daysToWait = 6 - day + self.dayOfWeek self.rolloverAt = self.rolloverAt + (daysToWait * (60 * 60 * 24)) __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1836> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com