QUERY · ISSUE
ntptime.py settime() does not cope with errors
This arose in the forum.
If an exception occurs in the time() function, msg is not updated so a value of -NTP_DELTA is returned. If this is the intended mechanism for reporting exceptions, settime() should check for this and avoid updating the RTC.
Or perhaps the finally clause in time() should re-raise the exception?
CANDIDATE · PULL REQUEST
ntptime: Allows manual timezone setting.
Adds only a minimal amount of code, allowing manual setting of the timezone.
Similar to this PR, but it's closed. https://github.com/micropython/micropython-lib/pull/634
Same issue as in: https://github.com/micropython/micropython-lib/pull/715
See my comment: https://github.com/micropython/micropython-lib/pull/715#issuecomment-1701200071
Thanks for submitting this PR. Everyone seems to agree MicroPython should solve this problem, but the best place is probably not in the
ntptimemodule (as NTP itself doesn't know about timezones, and numeric Unix timestamps are generally always in UTC.).I've started a Discussion here to talk about the possible ways forward for this:
https://github.com/orgs/micropython/discussions/12378
Please feel free to reply there with any other thoughts or suggestions.