This commit is contained in:
Elmwood Electronics 2025-08-19 15:14:36 +08:00 committed by GitHub
commit f4bc84dbe8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -93,6 +93,9 @@ def writetime(the_hr, the_min):
the_hr = the_hr + 1 # for the TO case
value = value | TO
# set hour
if the_hr == 24: # special case for Midnight
value = value | MIDNIGHT
return value
if the_hr > 12:
the_hr = the_hr - 12 # Convert 24 hour format to 12 hour
if the_hr == 1:
@ -117,8 +120,6 @@ def writetime(the_hr, the_min):
value = value | TEN
if the_hr == 11:
value = value | ELEVEN
if the_hr == 0:
value = value | MIDNIGHT
if the_hr == 12:
value = value | NOON
return value