In Python, how to display current time in readable format

后端 未结 6 1190
感情败类
感情败类 2020-12-07 18:15

How can I display the current time as:

12:18PM EST on Oct 18, 2010

in Python. Thanks.

6条回答
  •  抹茶落季
    2020-12-07 18:39

    Take a look at the facilities provided by the time module

    You have several conversion functions there.

    Edit: see the datetime module for more OOP-like solutions. The time library linked above is kinda imperative.

提交回复
热议问题