【问题标题】:Time zone for china not working in python arrow中国的时区在 python 箭头中不起作用
【发布时间】:2017-03-26 23:14:25
【问题描述】:
arrow.get('2016-01-01')
arrow.get(datetime.now(), 'US/Pacific')

arrow.get(datetime.now(), 'China')
arrow.get(datetime.now(), 'CT')
arrow.get(datetime.now(), 'CST')

因此,前两个语句有效,但其余 3 个试图将时间转换为中国时间的语句无效。我该如何解决这个问题?

【问题讨论】:

标签: python datetime python-arrow


【解决方案1】:

尝试使用 Asia/Shanghai 或 zh-cn 作为时区字符串。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-04-11
    • 2015-04-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-07
    • 1970-01-01
    相关资源
    最近更新 更多