PYTHON Learning 0043: Detailed --2019-8-10 function --- time module

To use the time module you must first import:
Import time
1, time.time (): print the current timestamp
PYTHON Learning 0043: Detailed --2019-8-10 function --- time module
represented from 1970 to the present through the second speed.
2, time.localtime (secs): time stamp is converted to a current time zone struct_time, when secs to provide, based on the time the current places.
PYTHON Learning 0043: Detailed --2019-8-10 function --- time module
Figures in parentheses may be Riga, returns the number corresponding to the time:
PYTHON Learning 0043: Detailed --2019-8-10 function --- time module

You can see contains many variables, you can use spliced forms represent time. For example:
first the time.time () assigned to the variable A
PYTHON Learning 0043: Detailed --2019-8-10 function --- time module
3.time.gmtime (): and localtime () method similar to, gmtime, () method returns the UTC time, i.e. Greenwich Mean Time, GMT eight hours later than
PYTHON Learning 0043: Detailed --2019-8-10 function --- time module
4 .time.mktime (): the conversion of a timestamp struct_time:
PYTHON Learning 0043: Detailed --2019-8-10 function --- time module
. 5, the time.sleep (secs): delayed thread specified amount of time, in seconds.
. 6, that time.asctime (): it indicates a time or ancestral struct_time as expressed in this form: Sat Aug 10 14:54:25 2019. If there are no parameters into the parameters, it will be time.localtime () as a parameter.
PYTHON Learning 0043: Detailed --2019-8-10 function --- time module
7, time.ctime (secs) a time stamp bar (floating point calculations in seconds) that time.asctime into () in the form, or if the parameter is not time.time None will default parameters. It acts time.asctime (time.localtime (secs)).
PYTHON Learning 0043: Detailed --2019-8-10 function --- time module
8, time.strftime (format [, t]): represents time tuples or struct_time (as indicated by time.localtime () and time.gmtime ()) returns a character string is converted to time format if not t specified, the incoming time.localtime ().
PYTHON Learning 0043: Detailed --2019-8-10 function --- time module
9, time.strptime (string [, format]) is time.strftime (format [, t]) reverse operation.
PYTHON Learning 0043: Detailed --2019-8-10 function --- time module

Guess you like

Origin blog.51cto.com/13543767/2428350