Python datetime&time

datetime.datetime.now()获取当前日期和时间

datetime.datetime(2019,9,30,22,22,0) 构造日期和时间函数

fromtimestamp () can be converted into a time stamp datetime objects

the strptime () and strftime () function strptime()function can be converted into a string date datetime types, strftime()functions can be converted to a string type datetime.

timedelta () Returns a timedelta data type, which represents a period of time rather than a time, the date used for increasing and decreasing the scenes

time module

time.time value returned by the function () is a decimal point, which indicates the number of seconds from the Unix epoch (at 0:00 on January 1 1970) to execute code that moment the elapsed time, the figure known as UNIX epoch timestamp .

the time.sleep () function. sleep () function has a parameter that indicates the number of seconds to pause.

Guess you like

Origin www.cnblogs.com/tingxin/p/12233511.html