Unofficial Nextion/TJC User Forum

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.

Many thanks - I will explore this.

This forum is in no way affiliated with NEXTION®, ITEAD STUDIO®, TJC®, or anyone else really. All product names, logos, and brands are property of their respective owners. All company, product, and service names used in this website are for identification purposes only. Use of these names, logos, and brands does not imply endorsement from the respective rights holder(s).