adafruit_ntp

Network Time Protocol (NTP) helper for CircuitPython

  • Author(s): Brent Rubell

Implementation Notes

Hardware: Software and Dependencies:

class adafruit_ntp.NTP(esp, debug=False)

Network Time Protocol (NTP) helper module for CircuitPython. This module does not handle daylight savings or local time.

Parameters:
  • esp (adafruit_esp32spi) – ESP32SPI object.
  • debug (bool) – Set to True to output set_time() failures to console
set_time(tz_offset=0)

Fetches and sets the microcontroller’s current time in seconds since since Jan 1, 1970.

Parameters:tz_offset (int) – The offset of the local timezone, in seconds west of UTC (negative in most of Western Europe, positive in the US, zero in the UK).