timezone
All checks were successful
Build Release / build (push) Successful in 1m27s

This commit is contained in:
2026-08-16 19:21:03 +02:00
parent fb884acc27
commit d80600863a
2 changed files with 12 additions and 28 deletions

View File

@@ -626,12 +626,13 @@ void setup() {
}
SplashScreen::setStatusLine(tft, 2, I18n::t(StringId::SPLASH_READY));
// Once IP geolocation has provided a UTC offset, set the
// timezone accordingly - timestamps (flight log, log file names)
// then show the REAL local time instead of UTC, automatically correct worldwide.
if (LocationManager::hasUtcOffset()) {
configTime(LocationManager::utcOffsetSeconds(), 0, "pool.ntp.org", "time.nist.gov");
}
// Sync time via NTP (UTC), then set timezone to Central European
// Time (Copenhagen) with automatic DST handling (CET/CEST).
// This makes localtime_r() return the correct local time year-round
// regardless of when the device was booted.
configTime(0, 0, "pool.ntp.org", "time.nist.gov");
setenv("TZ", "CET-1CEST-2,M3.5.0/2,M10.5.0/3", 1);
tzset();
AircraftTable::init();
AirlineLookup::init();