日期转换
import datetime
timestamps = [
1708327556987000000,
1708322082973000000,
1708321797134000000,
1708326492309000000,
1708327485668000000,
1708321916343000000,
1708320276881000000,
1708319234288000000,
1708326375111000000,
1708326659687000000,
1708320118169000000,
1708319008186000000,
1708322176233000000
]
for timestamp in timestamps:
dt_obj = datetime.datetime.fromtimestamp(timestamp / 1000000000)
print(dt_obj.strftime("%Y-%m-%d %H:%M:%S"))
输出:
2024-02-19 15:25:56
2024-02-19 13:54:42
2024-02-19 13:49:57
2024-02-19 15:08:12
2024-02-19 15:24:45
2024-02-19 13:51:56
2024-02-19 13:24:36
2024-02-19 13:07:14
2024-02-19 15:06:15
2024-02-19 15:10:59
2024-02-19 13:21:58
2024-02-19 13:03:28
2024-02-19 13:56:16