import time
# 时间戳
the_time = 1629891682.7282898
print(the_time)
# 时间戳转结构再转格式
struct_time = (time.localtime(the_time))
print(struct_time)
str_time = (time.strftime("%Y-%m-%d %H:%M:%S", struct_time))
# 格式化时间转时间戳
struct_time1 = (time.strptime(str_time, "%Y-%m-%d %H:%M:%S"))
print(struct_time1)
last_time = time.mktime(struct_time)
print(last_time)
import time
# 时间戳
the_time = 1629891682.7282898
print(the_time)
# 时间戳转结构再转格式
struct_time = (time.localtime(the_time))
print(struct_time)
str_time = (time.strftime("%Y-%m-%d %H:%M:%S", struct_time))
# 格式化时间转时间戳
struct_time1 = (time.strptime(str_time, "%Y-%m-%d %H:%M:%S"))
print(struct_time1)
last_time = time.mktime(struct_time)
print(last_time)