forked from micropython/micropython
-
Couldn't load subscription status.
- Fork 1.3k
Open
Labels
Milestone
Description
CircuitPython version
Adafruit CircuitPython 8.2.8 on 2023-11-16; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3Code/REPL
import time
import rtc
now = time.struct_time((2024, 1, 12, 21, 51, 40, 4, 12, 0))
print(now)
rtc.RTC().datetime = now
now = time.localtime()
print(now)Behavior
struct_time(tm_year=2024, tm_mon=1, tm_mday=12, tm_hour=21, tm_min=51, tm_sec=40, tm_wday=4, tm_yday=12, tm_isdst=0)
struct_time(tm_year=2024, tm_mon=1, tm_mday=12, tm_hour=21, tm_min=51, tm_sec=40, tm_wday=4, tm_yday=12, tm_isdst=-1)
Description
It appears that the tm_isdst is not saved as part of the RTC. It does not thrown an error, but it always returns -1 when getting the time from the RTC. From the example above, I set the tm_isdst to 0, but when I get the time from the RTC, it returns -1.
I am not sure if this is something specific to the ESP32, or with the RTC library more generally.
Additional information
No response