Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpha
physical
Commits
29407cf9
Commit
29407cf9
authored
Oct 20, 2019
by
吴升宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix celery timezone
parent
2cf5666b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
timelib.py
libs/timelib.py
+1
-1
No files found.
libs/timelib.py
View file @
29407cf9
...
...
@@ -27,7 +27,7 @@ def get_rand_time(hourlow=0, hourup=13, minutelow=0, minuteup=60):
hours
=
random
.
randint
(
hourlow
,
hourup
)
minutes
=
random
.
randint
(
minutelow
,
minuteup
)
# todo redis会自动给加8个小时,所以这边先写死减少8小时
now_time
=
NOW
+
timedelta
(
hours
=
hours
,
minutes
=
minutes
)
-
timedelta
(
hours
=
8
)
now_time
=
NOW
+
timedelta
(
hours
=
hours
,
minutes
=
minutes
)
time
=
eta_2_push_time
(
now_time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
))
print
(
datetime
.
fromtimestamp
(
time
,
pytz
.
timezone
(
'Asia/Shanghai'
)))
return
datetime
.
fromtimestamp
(
time
,
pytz
.
timezone
(
'Asia/Shanghai'
))
...
...
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