Using Nextion RTC

Has anyone used the built-in RTC ?

I have just started using a 3.2 Enhanced but I cannot find any code examples for setting or reading the RTC, and very little in the Nextion Docs.

Can anyone help ? Thanks.

There are 7 numeric system variables, rtc0 (year), rtc1 (month), rtc2 (day), rtc3 (hour), rtc4 (minute), rtc5 (second), and rtc6 (dayOfWeek).

Setting the RTC is done by setting rtc0 to rtc5, for example rtc0=2020, rtc1=9, rtc2=21, rtc3=8, rtc4=41, rtc5=30. rtc6 is read-only and will automatically be set according to rt0-rtc2.

Reading the RTC is simply done by reading these system variables and using these to update display components.

1 Like

Many thanks - I will explore this.