Time
Time processing module, the usual time is the East Eight district Beijing (Shanghai) time, in UTC standard Time + 8 hours
Gets the timestamp . time
# January 1, 1970 00:00, until now time
Import Timeprint (Time.time ())
Gets the local time . LocalTime
# You can also pass in a timestamp to convert to a time stamp corresponding to the time
Import Timeprint (Time.localtime ()) Print (Time.localtime (15279905.9574919))
How many seconds to suspend the thread, and the analog IO jam . Sleep
Import Timetime.sleep (2) print ("Beimenchuixue")
Format time . strftime
# Common year%Y month%m day%d%H minutes%m seconds%s
Import Timeprint (Time.strftime ("%y-%m-%d%h:%m:%s"), Time.localtime ())
Specifies the format resolution time . Strptime
# Convert to localtime time format
Import Timeprint (Time.strptime ("2017-5-4", "%y-%m-%d"))
Convert to timestamp . Mktime
# Incoming LocalTime time format, Federated Strptime use
Import Timeprint (Time.mktime (Time.strptime ("2017-5-4", "%y-%m-%d"))
python-Time Module-time