RTC initialisation

the RTC functionality in Blynk2.0 only seems to work when the statement “#include <WidgetRTC.h>” is added to the sketch. I am using the Blynk 1.0.1 library. Is this the expected behaviour?

In addition, I don’t get any compilation error when the “WidgetRTC.h” is not included (using the Arduino IDE 1.8.13) but time sync does not work in that situation.

thanks.

check this out :

https://docs.blynk.io/en/blynk.edgent/api/rtc-clock

Thanks, yes I know the RTCWidget is legacy and that is exactly what is confusing me, I do use:

BLYNK_CONNECTED() {
Blynk.sendInternal(“rtc”, “sync”);
}

but still need to include the widgetRTC.h file in my sketch to get RTC to work, strange.

You can get time, date, weather, etc… using http. If you would like to use http, check this out :

retrieving the realtime clock form the Blynk cloud is not the issue, that is working. I am just curious why I have to include that .h file.