Skip to content

Commit 52656da

Browse files
committed
Hour 12 is 12PM; display it as 12p not 12a
1 parent d5aeaa3 commit 52656da

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

MagTag_Cat_Fed_Clock/code.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def hh_mm(time_struct, twelve_hour=True):
3939
elif time_struct.tm_hour > 0:
4040
hour_string = str(time_struct.tm_hour) # 1-12
4141
postfix = "a"
42+
if time_struct.tm_hour == 12:
43+
postfix = "p" # 12 -> 12 (pm)
4244
else:
4345
hour_string = '12' # 0 -> 12 (am)
4446
postfix = "a"

0 commit comments

Comments
 (0)