📜  从 12 hrs 转换为 24 python 代码示例

📅  最后修改于: 2022-03-11 14:45:12.768000             🧑  作者: Mango

代码示例1
>>> from datetime import datetime
    >>> m2 = '1:35 PM'
    >>> in_time = datetime.strptime(m2, "%I:%M %p")
    >>> out_time = datetime.strftime(in_time, "%H:%M")
    >>> print(out_time)
    13:35