Skip to content

RTC does not save 'tm_isdst' #8794

@ilikecake

Description

@ilikecake

CircuitPython version

Adafruit CircuitPython 8.2.8 on 2023-11-16; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3

Code/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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions