FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
snippet-code/PythonNote/timeInPython.py at master · intergret/snippet-code · GitHub
intergret
/
snippet-code
Public
Notifications
You must be signed in to change notification settings
Fork
75
Star
56
Code
Issues
0
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
snippet-code
/
PythonNote
/
timeInPython.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
14 lines (10 loc) · 406 Bytes
Breadcrumbs
snippet-code
/
PythonNote
/
timeInPython.py
Copy path
File metadata and controls
14 lines (10 loc) · 406 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import
datetime
# 从开始时间起,每个50小时输出对应时间是星期几
def
mymain
():
datetimeStart
=
datetime
.
datetime
.
strptime
(
'2012 03 04 15:15:33'
,
'%Y %m %d %H:%M:%S'
)
datetimeEnd
=
datetime
.
datetime
.
now
()
while
datetimeStart
<
datetimeEnd
:
print
datetimeStart
.
strftime
(
'%Y-%m-%d %H:%M:%S'
),
'
\t
'
,
datetimeStart
.
isoweekday
()
datetimeStart
+=
datetime
.
timedelta
(
hours
=
50
)
if
__name__
==
'__main__'
:
mymain
()
Back
|
FazBrowse Home
|
New Git URL