delay(2000); // wait for RTC to initialize
if (! rtc.initialized() || rtc.lostPower()) {
Serial.println("RTC is NOT initialized. You must set the time.");
// this line will set the date & time to a hard-coded value
rtc.adjust(DateTime(2024, 8, 5, 7, 5, 0)); // rtc.adjust(DateTime(yyyy, mo, day, hr, min, sec))
// OTOH this line will set the date & time to the time of your PC as of the last time this sketch was compiled
// rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
}