Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
74a83e9f
Commit
74a83e9f
authored
Jan 16, 2006
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in time-to-midnight calculation.
parent
b8967599
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
Lib/logging/handlers.py
Lib/logging/handlers.py
+6
-3
No files found.
Lib/logging/handlers.py
View file @
74a83e9f
...
...
@@ -212,9 +212,12 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
currentMinute
=
t
[
4
]
currentSecond
=
t
[
5
]
# r is the number of seconds left between now and midnight
r
=
(
24
-
currentHour
)
*
60
*
60
# number of hours in seconds
r
=
r
+
(
59
-
currentMinute
)
*
60
# plus the number of minutes (in secs)
r
=
r
+
(
59
-
currentSecond
)
# plus the number of seconds
if
(
currentMinute
==
0
)
and
(
currentSecond
==
0
):
r
=
(
24
-
currentHour
)
*
60
*
60
# number of hours in seconds
else
:
r
=
(
23
-
currentHour
)
*
60
*
60
r
=
r
+
(
59
-
currentMinute
)
*
60
# plus the number of minutes (in secs)
r
=
r
+
(
60
-
currentSecond
)
# plus the number of seconds
self
.
rolloverAt
=
currentTime
+
r
# If we are rolling over on a certain day, add in the number of days until
# the next rollover, but offset by 1 since we just calculated the time
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment