This commit is contained in:
Kovid Goyal 2025-04-05 10:34:42 +05:30
parent 4508e482a7
commit 3b95ee47ba
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

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