diff --git a/tasmota/support_rtc.ino b/tasmota/support_rtc.ino index fc8a14042..9884b337f 100644 --- a/tasmota/support_rtc.ino +++ b/tasmota/support_rtc.ino @@ -400,6 +400,15 @@ void RtcSecond(void) } else { TasmotaGlobal.rules_flag.time_set = 1; } + +#ifdef ESP32 + // Sync RTOS time to be used by SD Card time stamps + struct timeval tv; + tv.tv_sec = Rtc.local_time; + tv.tv_usec = 0; + settimeofday(&tv, nullptr); +#endif // ESP32 + } else { Rtc.utc_time++; // Increment every second }