Difference between Python datetime vs time modules

前端 未结 4 936
遇见更好的自我
遇见更好的自我 2020-11-28 21:59

I am trying to figure out the differences between the datetime and time modules, and what each should be used for.

I know that dateti

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-28 22:38

    the time module is principally for working with unix time stamps; expressed as a floating point number taken to be seconds since the unix epoch. the datetime module can support many of the same operations, but provides a more object oriented set of types, and also has some limited support for time zones.

提交回复
热议问题