Fix time bug
This commit is contained in:
parent
3fc8b65fe2
commit
a851076a44
@ -1,13 +1,13 @@
|
||||
import pytz
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
pytz.timezone("Asia/Shanghai")
|
||||
tz = pytz.timezone("Asia/Shanghai")
|
||||
date_format = "%Y/%m/%d %H:%M:%S"
|
||||
|
||||
|
||||
def strf_time(data: int) -> str:
|
||||
# data = 1648111686000
|
||||
ts = datetime.fromtimestamp(data/1000)
|
||||
ts = datetime.fromtimestamp(data/1000, tz)
|
||||
return ts.strftime(date_format)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user