rp2/modutime: Fix time.localtime day-of-week value.

The correct day-of-week is stored in the RTC (0=Monday, 6=Sunday) so there
is no need to adjust it for the return value of time.localtime().

Fixes issue #7889.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2022-02-03 00:12:08 +11:00
parent 31f2440388
commit 5679fe6aee
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ STATIC mp_obj_t time_localtime(size_t n_args, const mp_obj_t *args) {
mp_obj_new_int(t.hour),
mp_obj_new_int(t.min),
mp_obj_new_int(t.sec),
mp_obj_new_int((t.dotw + 6) % 7), // convert 0=Sunday to 6=Sunday
mp_obj_new_int(t.dotw),
mp_obj_new_int(timeutils_year_day(t.year, t.month, t.day)),
};
return mp_obj_new_tuple(8, tuple);