fix(net): start SNTP with the saved timezone
configTime() sets TZ to UTC, which undid the saved rule on every join.
This commit is contained in:
+2
-2
@@ -97,8 +97,8 @@ void net::loop() {
|
||||
// Started per join rather than once at boot: a fresh lease may hand us a
|
||||
// different NTP server, and the daemon re-syncs on its own hourly from here.
|
||||
sntp_servermode_dhcp(1);
|
||||
configTime(0, 0, "pool.ntp.org",
|
||||
"time.nist.gov"); // UTC; the UI decides how to show it
|
||||
// configTime() would overwrite TZ with UTC, so hand it the saved rule.
|
||||
configTzTime(settings.timezone.c_str(), "pool.ntp.org", "time.nist.gov");
|
||||
Serial.println("[net] wifi up, sntp started");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user