Quantcast
Viewing latest article 10
Browse Latest Browse All 40

General Discussion and Questions • Re: The ntptime module documenation is confusing?

Hey - this is an old question on an almost-closed forum. But it's still showing up in search results and perhaps confusing users.

The link given by the OP as the NTP documentation:
is not the official library, and refers to a forked version of MicroPython for some IoT device developed in China.

The micropython-lib ntptime library is here: micropython-lib/micropython/net/ntptime at master · micropython/micropython-lib. Please note that it only supports UTC time, with the reason given as "There's currently no timezone support in MicroPython, and the RTC is set in UTC time".

Peter Hinch wrote a version that allows a time offset to be set: micropython-samples/ntptime/ntptime.py at master · peterhinch/micropython-samples. Note that, unlike the micropython-lib version, it doesn't set the RTC to the time returned from the NTP server.

Statistics: Posted by scruss — Thu Jan 11, 2024 3:44 pm



Viewing latest article 10
Browse Latest Browse All 40

Trending Articles