Skip to content

read RTC (esp32_get_rtc)

What it does: Returns the complete RTC date and time as a single structure.

esp32_get_rtc

Inputs

  • none.

Output

  • RTC date/time (tuple).

When to use it

  • When you want to process the entire time data at once.
  • When logging or diagnosing RTC status.

Tips and pitfalls

  • If you only need one folder, the cas_var block is more practical.
  • Without RTC/NTP initialization, the time returned may be default or inaccurate.

Generated Python example

from machine import RTC
rtc_tuple = RTC().datetime()