From 4bde8c52a17865d1d23164f6c351c75d8d5a8f7b Mon Sep 17 00:00:00 2001 From: Mike Weiblen Date: Fri, 10 Jun 2022 22:41:37 -0600 Subject: [PATCH] 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. --- examples/ds1307_simpletest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ds1307_simpletest.py b/examples/ds1307_simpletest.py index 4972ff3..ed3078e 100644 --- a/examples/ds1307_simpletest.py +++ b/examples/ds1307_simpletest.py @@ -14,7 +14,7 @@ rtc = adafruit_ds1307.DS1307(i2c) # Lookup table for names of days (nicer printing). -days = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday") +days = ("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday") # pylint: disable-msg=using-constant-test