日期时间与时间模块之间的差异 [英] difference between datetime vs time modules
问题描述
例子将不胜感激,时区的差异特别有意义。
谢谢。
时间
模块主要用于使用unix时间戳;表示为从unix纪元开始的秒数的浮点数。 datetime
模块可以支持许多相同的操作,但提供了一个更面向对象的类型集,并且还对时区有一些有限的支持。
I know that datetime provides both dates and time. What is the use of the time module? are there any differences? This might seem naive but, I am trying to figure out the differences, and what each should be used for.
Examples would be appreciated, differences concerning timezones would especially of interest.
Thanks.
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.
这篇关于日期时间与时间模块之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!