From 4eda63b4430b92307277ee9d775aa2612a77c490 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 3 Nov 2024 14:03:28 +0530 Subject: [PATCH] Dont limit the precision on timestamp serialization --- src/calibre/ebooks/oeb/polish/container.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/oeb/polish/container.py b/src/calibre/ebooks/oeb/polish/container.py index 9eb2d07b74..a8e95c1579 100644 --- a/src/calibre/ebooks/oeb/polish/container.py +++ b/src/calibre/ebooks/oeb/polish/container.py @@ -131,13 +131,13 @@ def href_to_name(href, root, base=None): def seconds_to_timestamp(duration: float) -> str: seconds = int(floor(duration)) - float_part = int((duration - seconds) * 1000) + float_part = duration - seconds hours = seconds // 3600 minutes = (seconds % 3600) // 60 seconds = seconds % 60 ans = f'{hours:02d}:{minutes:02d}:{seconds:02d}' if float_part: - ans += f'.{float_part}'.rstrip('0') + ans += f'{float_part}'.rstrip('0')[1:] return ans