Browse Source

fix timezone

main
Hendrik Langer 7 years ago
parent
commit
ebd3aa0dd4
  1. 4
      src/main.cpp
  2. 3
      src/screen.cpp

4
src/main.cpp

@ -99,7 +99,7 @@ void setup() {
time_t now;
struct tm timeinfo;
time(&now);
setenv("TZ", "Europe/Berlin", 1);
setenv("TZ", "CET-1CEST,M3.5.0/2,M10.5.0/3", 1);
tzset();
localtime_r(&now, &timeinfo);
@ -269,8 +269,6 @@ void loop()
time_t now;
struct tm timeinfo;
time(&now);
setenv("TZ", "Europe/Berlin", 1);
tzset();
localtime_r(&now, &timeinfo);
strftime(timeStr, sizeof(timeStr), "%H:%M:%S", &timeinfo);

3
src/screen.cpp

@ -330,6 +330,9 @@ void AlarmClockScreen::previous() {
}
uint8_t AlarmClockScreen::select() {
time_t now;
time(&now);
while(difftime(now, mktime(&alarmTime)) >= 0) alarmTime.tm_mday++;
setAlarmTime(alarmTime);
menuChange = eMainScreen;
}

Loading…
Cancel
Save