Import time refers to the import time module, which can be taken from Python , or it can be installed on its own, such as the use of numpy modules, which need to be installed themselves.
method One: Import time
Import Time
Print (Time.localtime ()) #这样就可以print local time.
""""
Time.struct_time (tm_year=2016, tm_mon=12, tm_mday=23, tm_hour=14, tm_min=12, tm_sec=48, tm_wday=4, tm_yday=358, tm_ isdst=0)
""""
method Two: Import time as __,__ the underline abbreviation section can be defined by itself, in the code to define time as T.
import time as T
Print (T.localtime ()) # needs to be prefixed with a T. prefix to Elicit functionality
""""
Time.struct_time (tm_year=2016, tm_mon=12, tm_mday=23, tm_hour=14, tm_min=12, tm_sec=48, tm_wday=4, tm_yday=358, tm_ isdst=0)
""""
method Three: From time import time,localtime, only import the function you want.
from time to import time, localtime
Print (LocalTime ())
Print (Time ())
""""
Time.struct_time (tm_year=2016, tm_mon=12, tm_mday=23, tm_hour=14, tm_min=41, tm_sec=38, tm_wday=4, tm_yday=358, tm_ isdst=0)
1482475298.709855
""""
method Four: From time import * All functions of input module
from time import *
Print (LocalTime ())
""""
Time.struct_time (tm_year=2016, tm_mon=12, tm_mday=23, tm_hour=14, tm_min=41, tm_sec=38, tm_wday=4, tm_yday=358, tm_ isdst=0)
""""