make ntp time variable public

This commit is contained in:
openshwprojects
2023-04-01 08:37:13 +02:00
parent f8fec8e087
commit 947d4ab6e0
3 changed files with 22 additions and 20 deletions

View File

@ -595,8 +595,8 @@ static int http_tasmota_json_status_generic(void* request, jsonCb_t printer) {
JSON_PrintKeyValue_String(request, printer, "RestartReason", "HardwareWatchdog", true);
JSON_PrintKeyValue_Int(request, printer, "Uptime", Time_getUpTimeSeconds(), true);
struct tm* ltm;
int g_time = NTP_GetCurrentTime() - Time_getUpTimeSeconds();
ltm = localtime((time_t*)&g_time);
int ntpTime = NTP_GetCurrentTime() - Time_getUpTimeSeconds();
ltm = localtime((time_t*)&ntpTime);
printer(request, "\"StartupUTC\":\"%04d-%02d-%02dT%02d:%02d:%02d\",", ltm->tm_year + 1900, ltm->tm_mon + 1, ltm->tm_mday, ltm->tm_hour, ltm->tm_min, ltm->tm_sec);