日期時間處理模塊:
time
calendar
當前時間戳: time.time() 以秒爲單位的小數
日期範圍:1970-01-01 到 2038年
時間元組:
獲取當前時間戳:time.time()
獲取當前時間的時間元組:time.localtime(時間戳)
獲取格式化日期:time.strftime("%Y-%m-%d %H:%M:%S",時間元組)
str = "2016-10-10 10:10:10"
字符串轉時間元組:time.strptime(str,"%Y-%m-%d %H:%M:%S")
時間元組轉時間戳:time.mktime(時間元組)