Skip to content

Commit 4bde8c5

Browse files
committed
Fix day-of-week string indexing to obey Python definition
Python defines "time.struct_time.tm_wday" (the day-of-week element) as "range [0, 6], Monday is 0"; see: https://docs.python.org/3/library/time.html#time.struct_time When expanding the day-of-week integer to a string, the code incorrectly used Sunday-as-0; probably a cut&paste error brought over from C code.
1 parent 401e6dd commit 4bde8c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/ds1307_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
rtc = adafruit_ds1307.DS1307(i2c)
1515

1616
# Lookup table for names of days (nicer printing).
17-
days = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
17+
days = ("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")
1818

1919

2020
# pylint: disable-msg=using-constant-test

0 commit comments

Comments
 (0)