Fix for Timezone.

master
Holger Wirtz 4 years ago
parent e86c9126ee
commit 5bac9a25ac
  1. 6
      WLAN_Thermometer.ino

@ -3,7 +3,7 @@
// //
// Use from 0 to 4. Higher number, more debugging messages and memory usage. // Use from 0 to 4. Higher number, more debugging messages and memory usage.
//#define _WIFIMGR_LOGLEVEL_ 4 //#define _WIFIMGR_LOGLEVEL_ 4
//#define DEBUG 1 #define DEBUG 1
#include <WiFi.h> #include <WiFi.h>
#include <WiFiManager.h> #include <WiFiManager.h>
@ -146,7 +146,7 @@ void setup()
lcd.setCursor(0, 3); lcd.setCursor(0, 3);
lcd.print("Getting time..."); lcd.print("Getting time...");
DateTime.setTimeZone("UTC+1"); DateTime.setTimeZone("CET-2");
DateTime.setServer(NTP_SERVER); DateTime.setServer(NTP_SERVER);
DateTime.begin(NTP_TIMEOUT); DateTime.begin(NTP_TIMEOUT);
/* while (!DateTime.isTimeValid()) /* while (!DateTime.isTimeValid())
@ -200,7 +200,7 @@ void loop()
if (!DateTime.isTimeValid() && millis() - 10000 > next_time_check) if (!DateTime.isTimeValid() && millis() - 10000 > next_time_check)
{ {
next_time_check = millis(); next_time_check = millis();
DateTime.setTimeZone("UTC+1"); DateTime.setTimeZone("CET-2");
DateTime.forceUpdate(); DateTime.forceUpdate();
if (is_wintertime(DateTime.getTime()) == false) if (is_wintertime(DateTime.getTime()) == false)
add_summertime = 1; add_summertime = 1;

Loading…
Cancel
Save