mirror of https://github.com/arendst/Tasmota.git
Fix time 4 display with SO52 1
This commit is contained in:
parent
24cd427625
commit
11d6486534
|
@ -997,7 +997,7 @@ char* ResponseGetTime(uint32_t format, char* time_str)
|
|||
snprintf_P(time_str, TIMESZ, PSTR("{\"" D_JSON_TIME "\":%u"), UtcTime());
|
||||
break;
|
||||
case 3:
|
||||
snprintf_P(time_str, TIMESZ, PSTR("{\"" D_JSON_TIME "\":\"%s.%03d\""), GetDateAndTime(DT_LOCAL).c_str(), RtcMillis());
|
||||
snprintf_P(time_str, TIMESZ, PSTR("{\"" D_JSON_TIME "\":\"%s\""), GetDateAndTime(DT_LOCAL_MILLIS).c_str());
|
||||
break;
|
||||
default:
|
||||
snprintf_P(time_str, TIMESZ, PSTR("{\"" D_JSON_TIME "\":\"%s\""), GetDateAndTime(DT_LOCAL).c_str());
|
||||
|
|
|
@ -206,6 +206,14 @@ String GetDateAndTime(uint8_t time_type)
|
|||
break;
|
||||
}
|
||||
String dt = GetDT(time); // 2017-03-07T11:08:02
|
||||
|
||||
if (DT_LOCAL_MILLIS == time_type) {
|
||||
char ms[10];
|
||||
snprintf_P(ms, sizeof(ms), PSTR(".%03d"), RtcMillis());
|
||||
dt += ms;
|
||||
time_type = DT_LOCAL;
|
||||
}
|
||||
|
||||
if (Settings.flag3.time_append_timezone && (DT_LOCAL == time_type)) { // SetOption52 - Append timezone to JSON time
|
||||
dt += GetTimeZone(); // 2017-03-07T11:08:02-07:00
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue