Skip to content

时区修改, 我好像理解有误? 居然出现4H开盘时间是23:00 #8

Open
@ydqsbfsyi

Description

我试了一下: examples/4.3 APP K线服务 维护实时历史K线.ipynb

改了一下时区, 尝试下载两个品种的k线, 然后开盘时间不对啊, 4H开盘时间怎么能是23:00

时间相关的代码:

from okx.app.candle_server import CandleRule,CandleServer
class MyCandleRule(CandleRule):
    TIMEZONE = 'Asia/Shanghai'
.......
import datetime
def stmptotime(stmp):
    temp = int(stmp)/1000.0   # open time from milisec to sec
    return datetime.datetime.fromtimestamp(temp)

这样看, 时区修改好像无效, 仍然是跑py代码的服务器的时间, 不是上海时间?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions