How to get the current time in Python

前端 未结 30 1784
滥情空心
滥情空心 2020-11-22 06:47

What is the module/method used to get the current time?

30条回答
  •  自闭症患者
    2020-11-22 07:26

    .isoformat() is in the documentation, but not yet here (this is mighty similar to @Ray Vega's answer):

    >>> import datetime
    >>> datetime.datetime.now().isoformat()
    '2013-06-24T20:35:55.982000'
    

提交回复
热议问题