网上找了几天的资料终于搞清怎么将excel的时间戳转成python的日期时间
1,excel里的时间戳是以1900年0点为基点,python识别处理的时间戳是以1970年8点为基点,所以需先将excel时间戳—>python的时间戳
公式:python的时间戳 = (excel时间戳 - 70*365 -19)*86400 - 8*3600
2,python处理时间戳需先将时间戳(时间戳是float类型数据)转成datetime对象
date_time1 = datetime.datetime.fromtimestamp(时间戳)
3,然后就可以用datetime包里的各种方法了,比如输出给定格式的日期时间字符串
datetime.datetime.strftime(date_time1,"%Y-%m-%d %H:%M:%S")