'''
模块分类
1.标准库
2.开源库
3.自定义库
'''
import time
a=time.time()
print(a)
x=time.localtime()
print(x)
print(time.gmtime())
print(time.mktime(x))
y=time.strftime('%Y-%m-%d %H:%M:%S',x)
print(y)
print(time.strptime(y,'%Y-%m-%d %H:%M:%S'))
print(time.asctime(x))
print(time.ctime(a))
import datetime
print(datetime.datetime.now())
print(datetime.datetime.now()+datetime.timedelta(3))
print(datetime.datetime.now()+datetime.timedelta(-3))
print(datetime.datetime.now()+datetime.timedelta(hours=3))
print(datetime.datetime.now()+datetime.timedelta(hours=-3))
print(datetime.datetime.now()+datetime.timedelta(minutes=3))
print(datetime.datetime.now()+datetime.timedelta(minutes=-3))
1582238621.0449994
time.struct_time(tm_year=2020, tm_mon=2, tm_mday=21, tm_hour=6, tm_min=43, tm_sec=41, tm_wday=4, tm_yday=52, tm_isdst=0)
time.struct_time(tm_year=2020, tm_mon=2, tm_mday=20, tm_hour=22, tm_min=43, tm_sec=41, tm_wday=3, tm_yday=51, tm_isdst=0)
1582238621.0
2020-02-21 06:43:41
time.struct_time(tm_year=2020, tm_mon=2, tm_mday=21, tm_hour=6, tm_min=43, tm_sec=41, tm_wday=4, tm_yday=52, tm_isdst=-1)
Fri Feb 21 06:43:41 2020
Fri Feb 21 06:43:41 2020
2020-02-21 06:43:41.177075
2020-02-24 06:43:41.177075
2020-02-18 06:43:41.177075
2020-02-21 09:43:41.177075
2020-02-21 03:43:41.177075
2020-02-21 06:46:41.177075
2020-02-21 06:40:41.177075