Skip to content

Why is the alarm year & month hardcoded to Jan 2017? #53

Closed

Description

@maholli

When reading an alarm set point, the tm_year attribute is hardcoded to return 2017 and tm_mon to return 1. Is this intentional? Caused by a limitation somewhere?

time.struct_time((2017, 1, mday, hour, minute, seconds, wday, mday, -1)),

In contrast, reading the datetime properly returns the year reported from the RTC:

_bcd2bin(self.buffer[7] & self.mask_datetime[7]) + 2000,

Activity

  1. tannewt commented on Jun 7, 2024

    @tannewt
    Member

    I don't remember. It was probably just a known point in time to base the frequency on. Maybe look in the DS3231 (iirc) datasheet for clues.

  2. maholli commented on Jun 7, 2024

    @maholli
    Author

    @tannewt yeah the DS3231 alarm registers specify the time up to the day (date). Not sure how you want this helper library to handle it, but at the very least the docs should include a warning.

  3. tannewt commented on Jun 10, 2024

    @tannewt
    Member

    PR to update the doc would be great!

  4. grgrant commented on Aug 18, 2026

    @grgrant

    Since this was documented as requested in #61 can this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions