取得現(xiàn)在時(shí)間的列表在python中的操作
提問(wèn)人:楊紫紅發(fā)布時(shí)間:2020-11-19
time.localtime 取得現(xiàn)在時(shí)間的列表
>>> import time
>>> print(time.localtime())
time.struct_time(tm_year=2020, tm_mon=2, tm_mday=23, tm_hour=22,
tm_min=18, tm_sec=39, tm_wday=0, tm_yday=73, tm_isdst=0)
>>> t = time.localtime()
>>> year = t[0]
>>> month = t[1]
>>> print(year)
2020
>>> print(month)
2
繼續(xù)查找其他問(wèn)題的答案?
相關(guān)視頻回答
點(diǎn)擊加載更多評(píng)論>>