From 42c2963bf06999d58073487640c270ca93038245 Mon Sep 17 00:00:00 2001 From: Star Brilliant Date: Sat, 16 Nov 2013 22:11:31 +0800 Subject: [PATCH] Fix ConvertTimestamp --- danmaku2ass.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/danmaku2ass.py b/danmaku2ass.py index 72d5c8b..6d5cd9e 100755 --- a/danmaku2ass.py +++ b/danmaku2ass.py @@ -412,10 +412,10 @@ def CalculateLength(s): def ConvertTimestamp(timestamp): - timestamp = round(timestamp*100.0)/100.0 - hour, minute = divmod(timestamp, 3600) - minute, second = divmod(minute, 60) - centsecond = second-int(second) + timestamp = round(timestamp*100.0) + hour, minute = divmod(timestamp, 360000) + minute, second = divmod(minute, 6000) + second, centsecond = divmod(second, 100) return '%d:%02d:%02d.%02d' % (int(hour), int(minute), int(second), int(centsecond))