def datetime_from_rietveld(date_string):
try:
return datetime.strptime(date_string, '%Y-%m-%d %H:%M:%S.%f')
except ValueError:
# Sometimes rietveld returns a value without the milliseconds part, so we
# attempt to parse those cases as well.
return datetime.strptime(date_string, '%Y-%m-%d %H:%M:%S')
评论列表
文章目录