Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

字符串时间与Unix时间戳转换时的时差问题 #31

Open
Syugen opened this issue Jul 23, 2019 · 0 comments
Open

字符串时间与Unix时间戳转换时的时差问题 #31

Syugen opened this issue Jul 23, 2019 · 0 comments

Comments

@Syugen
Copy link

Syugen commented Jul 23, 2019

modian.py中一段将字符串时间转换为Unix时间戳的代码,

CQBot_hzx/modian.py

Lines 188 to 189 in 8cd27c3

# 将字符串时间转换为unix时间戳
data['pay_success_time'] = int(time.mktime(time.strptime(pay_success_time, '%Y-%m-%d %H:%M:%S')))

由于我不在UTC+8时区经过debug发现这里会把字符串时间默认为当地时间,所以我需要手动加上我的时差才能正常运行。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant