Added fix for 'Mir egal ob die lokalzeit richtig is'

This commit is contained in:
CommanderRedYT
2022-04-29 23:10:39 +02:00
parent d277202fa3
commit 4c7e438c18
2 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@ public:
#ifdef CONFIG_ESPCHRONO_SUPPORT_DEFAULT_TIMEZONE
return fmt::format("local: {}", espchrono::toString(espchrono::toDateTime(espchrono::local_clock::now())));
#else // Mir egal ob die lokalzeit richtig is
return fmt::format("local: {}", espchrono::toString(espchrono::toDateTime(espchrono::utc_clock::now() + configs.timezoneOffset.value)));
return fmt::format("local: {}", espchrono::toString(espchrono::toDateTime(espchrono::utc_clock::now() + configs.timezoneOffset.value())));
#endif
}
};

View File

@ -277,7 +277,7 @@ std::string local_clock_string()
#ifdef CONFIG_ESPCHRONO_SUPPORT_DEFAULT_TIMEZONE
const auto now = espchrono::local_clock::now();
#else // mir egal ob die lokalzeit richtig is
const auto now = espchrono::utc_clock::now() + configs.timezoneOffset.value;
const auto now = espchrono::utc_clock::now() + configs.timezoneOffset.value();
#endif
const auto dt = espchrono::toDateTime(now);
return fmt::format("{:02d}:{:02d}:{:02d}", dt.hour, dt.minute, dt.second);