def _parse(x):
if isinstance(x, datetime.datetime):
return x
# 2014-08-28T13:56:16+00:00
# TODO: fix generation to generate consistent datetimes
if x[-6:] == '+00:00':
x = x[:-6]
if x.endswith('.999999'):
x = x[:-7]
if x.endswith('Z'):
x = x[:-1]
try:
dt = datetime.datetime.strptime(x, '%Y-%m-%dT%H:%M:%S')
except:
logging.fatal('Could not parse "%s"', x)
raise
return dt.replace(tzinfo=pytz.UTC)
compute_metrics.py 文件源码
python
阅读 33
收藏 0
点赞 0
评论 0
评论列表
文章目录