diff --git a/src/main/blackbox/blackbox.c b/src/main/blackbox/blackbox.c index ad787be2e4..a5a722726b 100644 --- a/src/main/blackbox/blackbox.c +++ b/src/main/blackbox/blackbox.c @@ -1187,15 +1187,15 @@ static bool sendFieldDefinition(char mainFrameChar, char deltaFrameChar, const v // Buf must be at least FORMATTED_DATE_TIME_BUFSIZE STATIC_UNIT_TESTED char *blackboxGetStartDateTime(char *buf) { - #ifdef USE_RTC_TIME +#ifdef USE_RTC_TIME dateTime_t dt; // rtcGetDateTime will fill dt with 0000-01-01T00:00:00 // when time is not known. rtcGetDateTime(&dt); dateTimeFormatLocal(buf, &dt); - #else +#else buf = "0000-01-01T00:00:00.000"; - #endif +#endif return buf; } diff --git a/src/main/common/time.c b/src/main/common/time.c index c15f104626..707cad7c38 100644 --- a/src/main/common/time.c +++ b/src/main/common/time.c @@ -200,7 +200,8 @@ bool dateTimeFormatUTC(char *buf, dateTime_t *dt) bool dateTimeFormatLocal(char *buf, dateTime_t *dt) { - return dateTimeFormat(buf, dt, timeConfig()->tz_offsetMinutes, false); + const int16_t timezoneOffset = rtcIsDateTimeValid(dt) ? timeConfig()->tz_offsetMinutes : 0; + return dateTimeFormat(buf, dt, timezoneOffset, false); } bool dateTimeFormatLocalShort(char *buf, dateTime_t *dt)