Skip to content

Commit 7c7e4ae

Browse files
Merge pull request #1600 from peterp415/cat-fed-clock-12p
Hour 12 is 12PM; display it as 12p not 12a
2 parents 526c7ed + 52656da commit 7c7e4ae

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)