Jelajahi Sumber

Merge pull request #4185 from argetlam-coder/fix-timezone-without-ntp

Apply configured time zone even when NTP is disabled
SybexXx 1 bulan lalu
induk
melakukan
80eaeae57f
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      code/components/jomjol_time_sntp/time_sntp.cpp

+ 2 - 2
code/components/jomjol_time_sntp/time_sntp.cpp

@@ -278,10 +278,10 @@ bool setupTime() {
         esp_sntp_config_t config = ESP_NETIF_SNTP_DEFAULT_CONFIG(timeServer.c_str());
         config.sync_cb = time_sync_notification_cb;
         esp_netif_sntp_init(&config);
-
-        setTimeZone(timeZone);
     }
 
+    setTimeZone(timeZone);
+
     /* The RTC keeps the time after a restart (Except on Power On or Pin Reset) 
      * There should only be a minor correction through NTP */