Commit 867b198e authored by 吴升宇's avatar 吴升宇

fix celery timezone

parent 81e706fe
......@@ -29,8 +29,8 @@ def get_rand_time(hourlow=0, hourup=13, minutelow=0, minuteup=60):
# todo redis会自动给加8个小时,所以这边先写死减少8小时
now_time = NOW + timedelta(hours=hours, minutes=minutes) - timedelta(hours=8)
time = eta_2_push_time(now_time.strftime("%Y-%m-%d %H:%M:%S"))
print(datetime.fromtimestamp(time))
return datetime.fromtimestamp(time)
print(datetime.fromtimestamp(time, pytz.timezone('Asia/Shanghai')))
return datetime.fromtimestamp(time, pytz.timezone('Asia/Shanghai'))
if __name__ == '__main__':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment