in python time module

1.time.strftime (% Y-% m-% d% H:% M:% S) # Get the current time formatted good

2.time.time () # get the current timestamp

3. time.gmtime () # get the formatting standard time zones is a good time

    time.localtime () # get the local formatting a good time

4. The conversion between the time stamp and formatted: introducing time required tuple

a. formatted time stamp is converted to

time_tuple=time.localtime()

print(time.strftime('%Y-%m-%d %H:%M:%S',time_tuple))

b. formatted into a timestamp Time

time_tuple=time.strftime('2019-06-02','%Y-%m-%d %H:%M:%S')

print(time.mktime(time_tuple))

Guess you like

Origin www.cnblogs.com/dmjsd/p/11166044.html