in Python, there are usually several ways to represent time: 1) timestamp 2) formatted time string 3) tuples (struct_time) a total of nine elements.
because Python's time module implementation primarily calls the C library, each platform may be different.
UTC (coordinated Universal time, world co-ordination) is GMT, world standard Time. In China for Utc+8. DST (daylight saving time) is daylight saving time.
Timestamp (timestamp): Typically, a timestamp represents an offset that is calculated in seconds starting January 1, 1970 00:00:00 .
We Run "type (Time.time ())" and return the float type. The function that returns the Timestamp method mainly has time (), clock () and so on.
tuple (struct_time) mode: There are 9 elements in the Struct_time tuple, and the functions that return struct_time are mainly gmtime (), localtime (), Strptime ().
several elements in this way tuple are listed below:
Index (Index) property (Attribute) value (values)
0 Tm_year (years) such as
1 Tm_mon (month) 1-12
2 Tm_mday (Sun) 1-31
3 Tm_hour (hours) 0-23
4 tm_min (min) 0-59
5 tm_sec (sec) 0-61
6 Tm_wday (weekday) 0-6 (0 = Sunday)
7 Tm_yday (Day ordinal of the year) 1-366
8 tm_isdst (Daylight saving time) The default is-1
Python Basic Learning log day5-time &datetime module