Just remember that currently, RP2040-based boards RTC has no battery backup. So the time will be lost when power down. Therefore, NTP client is necessary to get precise NTP time to update RTC.
Thanks very much for the new RP2040_RTC Time and Alarm examples which make it easier to understand the code while I am learning.
However, when I run the example code for my Pico using EarlePhilhower RP2040 Core I get the following error message:
I found an article https://forum.arduino.cc/t/confusion-with-time-h-and-timelib-h/433864 which indicates that some Windows users have problems when compiling code which uses the Time.h library and so I modifed the statement in DateTime_Generic.h library from #include <Time.h> to #include <TimeLib.h> and it overcomes the errors.
That's good you found out the solution as well as the reason.
It's really bad that Windows still behaves the same way as the bad old DOS (case insensitive). That's why I've been avoiding using Windows quite a long time and didn't see that issue.
Anyway, I'll fix the library in next release for completeness.
It turns out that macOS also uses a case insensitive file system. So Linux's behavior is actually in the (sensible) minority. I always used to think that Windows was the only one, like with the annoying path separator.
Due to how common this problem is with the Time library, its maintainer Paul Stoffregen has finally removed the Time.h file from the library altogether in the release of the library made this week:
This will break all code which is still using the Windows/macOS-incompatible Time.h, forcing the maintainers to switch to TimeLib.h.