您的位置:首页 > 编程语言 > Python开发

ArcMap中毫秒转换为日期格式

2016-09-29 09:27 513 查看
参考http://blog.csdn.net/muzilanlan/article/details/45647883

最近遇到一个问题,需要将shp图层中的毫秒值转换日期格式,参考上面的文章,自己进行了如下修改:

import time
#秒转换为日期
def Time2ISOString(s):
if (s.strip() and not s.__contains__("-")):
return time.strftime("%Y-%m-%d", time.localtime(float(s) / 1000))
else: return s

print Time2ISOString("1456531200000");

在ArcMap中调用


即可得到结果
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python arcgis