【问题标题】:How to convert datetime string to another format [duplicate]如何将日期时间字符串转换为另一种格式[重复]
【发布时间】:2016-02-02 07:33:28
【问题描述】:

如何将2015-10-22T22:24:00.000转换为yyyy-MM-dd hh:mm格式的日期时间字符串,以获取2015-10-22 22:24

【问题讨论】:

  • 你真的尝试过什么吗?发生了什么?

标签: python date parsing


【解决方案1】:

使用 dateutil.parser.parse() 将日期字符串解析为可识别时区的 datetime 对象,然后使用 strftime() 获取您想要的格式。

为了更好的解释goto

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-07-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多