Hour 12 is 12PM; display it as 12p not 12a

This commit is contained in:
Peter Pletcher 2021-07-09 12:08:34 -07:00
parent d5aeaa317b
commit 52656daace

View file

@ -39,6 +39,8 @@ def hh_mm(time_struct, twelve_hour=True):
elif time_struct.tm_hour > 0:
hour_string = str(time_struct.tm_hour) # 1-12
postfix = "a"
if time_struct.tm_hour == 12:
postfix = "p" # 12 -> 12 (pm)
else:
hour_string = '12' # 0 -> 12 (am)
postfix = "a"