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}'