The 'RTC' module belongs to MicroPython and handles basic 8-field translation from timestamps (milliseconds since 00:00:00 1 Jan 1970) to a years-months-days-etc array. I don't see any official mention that it's based on a physical RTC or any guarantee of accuracy:
https://docs.micropython.org/en/latest/ ... e.RTC.html
The 'time' module is a standard Python module roughly equivalent to, but with more functions than, the 'RTC' module. Again, it just reads values provided by the OS with no guarantee of accuracy:
https://docs.python.org/3.8/library/tim ... odule-time
The 'datetime' module has a much richer set of functions for calculating time and intervals:
https://docs.python.org/3.8/library/datetime.html
The 'adafruit_datetime' module is our fork of 'datetime' scaled down for microcontrollers. Again, it's made for calculation using timestamps rather than timekeeping in its own right.
The 'NTP' module handles communication with a timeserver. As such, it does provide some guarantees of accuracy and syncronization with other devices that also use NTP time.
To get information from a physical RTC like the DS3231 you need to use a module that can talk to the device, like our 'adafruit_ds3231' module:
https://github.com/adafruit/Adafruit_Ci ... hon_DS3231
That module uses timestamps that are compatible with the previous modules. You can set the physical RTC's timestamp by assigning a 'time' module datestamp to the 'adafruit_ds3231' module's 'datetime' attibute:
Code: Select all
rtc.datetime = time.struct_time((2017,1,9,15,6,0,0,9,-1))
then read the 'datetime' attribute later to get readings from the physical RTC.
So the basic division is between modules that perform calculations on timestamps (RTC, time, datetime, adafruit_datetime) and modules that communicate with timekeeping devices (NTP, adafruit_ds3231).