Python实现日期时间 yyyy-MM-dd HH:mm:ss
格式转时间戳格式
import time
time_list = ['2023-07-01 16:14:00','2023-07-01 10:17:00']
if __name__ == '__main__':
for t in time_list:
st = time.strptime(t, "%Y-%m-%d %H:%M:%S")
mkt = int(time.mktime(st))
print(mkt)
pass
文档信息
- 本文作者:carpe
- 本文链接:https://carpedx.com/fragment/python-time-to-timestamp-format/
- 版权声明:自由转载-非商用-非衍生-保持署名(创意共享3.0许可证)