python如何批量把时间戳转换成北京时间
python真的很强大,简单几句就恶意搞定,代码如下:
01#! /usr/bin/env python 02#coding=utf-8 03 04 05import time 06 07kaishi = time.time() 08for y in open("time.txt","r"): 09 x = time.localtime(int(y.strip()[:10])) 10 ok = time.strftime('%Y-%m-%d %H:%M:%S',x) 11 f = open("timeok.txt","a") 12 f.write(ok+" 13") 14 f.close() 15print time.time()-kaishi
秋蝉博客www.100msh.net
The End
发布于:2021-04-11,除非注明,否则均为
原创文章,转载请注明出处。
还没有评论,来说两句吧...