Update to use .format for strings
This commit is contained in:
parent
ddb47d13f2
commit
6f1a1320ab
1 changed files with 2 additions and 2 deletions
|
|
@ -43,8 +43,8 @@ while True:
|
|||
if current.tm_hour / 12 >= 1:
|
||||
am_pm = "PM"
|
||||
|
||||
time_display = "%d:%02d:%02d %s" % (hour, current.tm_min, current.tm_sec, am_pm)
|
||||
date_display = "%d/%d/%d" % (current.tm_mon, current.tm_mday, current.tm_year)
|
||||
time_display = "{:d}:{:02d}:{:02d} {}".format(hour, current.tm_min, current.tm_sec, am_pm)
|
||||
date_display = "{:d}/{:d}/{:d}".format(current.tm_mon, current.tm_mday, current.tm_year)
|
||||
text_display = "CircuitPython Time"
|
||||
|
||||
clock = label.Label(font, text=time_display)
|
||||
|
|
|
|||
Loading…
Reference in a new issue