1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 21:05:35 +03:00

Fix RTC local time formatting (timezone offset) when no valid d… (#8731)

Fix RTC local time formatting (timezone offset) when no valid date/time
This commit is contained in:
Michael Keller 2019-08-19 23:32:48 +12:00 committed by GitHub
commit cbe8749d69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -200,7 +200,8 @@ bool dateTimeFormatUTC(char *buf, dateTime_t *dt)
bool dateTimeFormatLocal(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) bool dateTimeFormatLocalShort(char *buf, dateTime_t *dt)