From 3b95ee47ba2e2d9f6ca23944666b6a39e540e1af Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 5 Apr 2025 10:34:42 +0530 Subject: [PATCH] ... --- src/calibre/utils/date.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/utils/date.py b/src/calibre/utils/date.py index 73596dbe38..2ac5a6f577 100644 --- a/src/calibre/utils/date.py +++ b/src/calibre/utils/date.py @@ -289,7 +289,7 @@ def timestampfromdt(dt, assume_utc=True): # Format date functions {{{ def fd_format_hour(dt, ampm, hr): - h = strftime('%I' if ampm else '%H', t=dt.timetuple()) + h = int(strftime('%I' if ampm else '%H', t=dt.timetuple()).strip()) if len(hr) == 1: return f'{h}' return f'{h:02}'