diff --git a/common/common/segments.py b/common/common/segments.py index e2fd84d..7400658 100644 --- a/common/common/segments.py +++ b/common/common/segments.py @@ -14,6 +14,7 @@ import shutil import sys from collections import namedtuple from contextlib import closing +from decimal import Decimal from tempfile import TemporaryFile import gevent @@ -53,7 +54,7 @@ def parse_segment_timestamp(hour_str, min_str): day = int(hour_str[8:10]) hour = int(hour_str[11:13]) min = int(min_str[0:2]) - sec_float = float(min_str[3:]) + sec_float = Decimal(min_str[3:]) sec = int(sec_float) microsec = int(1000000 * (sec_float % 1)) return datetime.datetime(year, month, day, hour, min, sec, microsec)