mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-09-13 21:54:07 +00:00
set boottime for RTC (if rtc is set)
This commit is contained in:
+1
-1
@@ -853,7 +853,7 @@ void System::send_info_mqtt() {
|
|||||||
|
|
||||||
// if NTP is enabled send the boot_time in local time in ISO 8601 format (eg: 2022-11-15 20:46:38)
|
// if NTP is enabled send the boot_time in local time in ISO 8601 format (eg: 2022-11-15 20:46:38)
|
||||||
// https://github.com/emsesp/EMS-ESP32/issues/751
|
// https://github.com/emsesp/EMS-ESP32/issues/751
|
||||||
if (ntp_connected_) {
|
if (time(nullptr) > 1500000000L) {
|
||||||
char time_string[25];
|
char time_string[25];
|
||||||
time_t now = time(nullptr) - uuid::get_uptime_sec();
|
time_t now = time(nullptr) - uuid::get_uptime_sec();
|
||||||
strftime(time_string, 25, "%FT%T%z", localtime(&now));
|
strftime(time_string, 25, "%FT%T%z", localtime(&now));
|
||||||
|
|||||||
Reference in New Issue
Block a user