svn --xml 出来的时间值一开始解析
def svn_date_to_timestamp(svn_date):
date = svn_date.split('.', 2)[0]
time_tuple = time.strptime(date, "%Y-%m-%dT%H:%M:%S")
return strftime("%Y-%m-%d %H:%M:%S",(time_tuple))
#这样输出的时间就是标准的时间戳!
def svn_date_to_timestamp(svn_date):
date = svn_date.split('.', 2)[0]
time_tuple = time.strptime(date, "%Y-%m-%dT%H:%M:%S")
tmp = calendar.timegm(time_tuple)
return datetime.fromtimestamp(tmp)
阅读(1689) | 评论(0) | 转发(0) |