兩種時間戳類型
例如s1=1704879917000
1、13位的時間戳:單位(毫秒)
(1)毫秒變成秒,1s=1000ms,s1/1000(秒)
(2)加載時間
times = time.localtime(s1/1000)
(3)時間格式化
time.strftime("%Y-%m-%d", times)#格式化后的格式:例如:2024-01-10%Y Year with century as a decimal number.%m Month as a decimal number [01,12].%d Day of the month as a decimal number [01,31].%H Hour (24-hour clock) as a decimal number [00,23].%M Minute as a decimal number [00,59].%S Second as a decimal number [00,61].%z Time zone offset from UTC.%a Locale's abbreviated weekday name.%A Locale's full weekday name.%b Locale's abbreviated month name.%B Locale's full month name.%c Locale's appropriate date and time representation.%I Hour (12-hour clock) as a decimal number [01,12].%p Locale's equivalent of either AM or PM.
2、10位的時間戳:單位(秒)
times = time.localtime(s1)