diff --git a/tasmota/support.ino b/tasmota/support.ino index 8d915cf05..b27cb072d 100644 --- a/tasmota/support.ino +++ b/tasmota/support.ino @@ -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()); diff --git a/tasmota/support_rtc.ino b/tasmota/support_rtc.ino index e918ae99d..445976eb3 100644 --- a/tasmota/support_rtc.ino +++ b/tasmota/support_rtc.ino @@ -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 }