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
97958cf3
Commit
97958cf3
authored
Jun 14, 2010
by
Alexander Belopolsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Undo r81988 code change leaving added test.
parent
43ca710a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
Lib/calendar.py
Lib/calendar.py
+8
-3
No files found.
Lib/calendar.py
View file @
97958cf3
...
@@ -587,12 +587,17 @@ def formatstring(cols, colwidth=_colwidth, spacing=_spacing):
...
@@ -587,12 +587,17 @@ def formatstring(cols, colwidth=_colwidth, spacing=_spacing):
EPOCH
=
1970
EPOCH
=
1970
_EPOCH_
DATETIME
=
datetime
.
datetime
(
EPOCH
,
1
,
1
)
_EPOCH_
ORD
=
datetime
.
date
(
EPOCH
,
1
,
1
).
toordinal
(
)
_SECOND
=
datetime
.
timedelta
(
seconds
=
1
)
def
timegm
(
tuple
):
def
timegm
(
tuple
):
"""Unrelated but handy function to calculate Unix timestamp from GMT."""
"""Unrelated but handy function to calculate Unix timestamp from GMT."""
return
(
datetime
.
datetime
(
*
tuple
[:
6
])
-
_EPOCH_DATETIME
)
//
_SECOND
year
,
month
,
day
,
hour
,
minute
,
second
=
tuple
[:
6
]
days
=
datetime
.
date
(
year
,
month
,
1
).
toordinal
()
-
_EPOCH_ORD
+
day
-
1
hours
=
days
*
24
+
hour
minutes
=
hours
*
60
+
minute
seconds
=
minutes
*
60
+
second
return
seconds
def
main
(
args
):
def
main
(
args
):
...
...
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