From 7fceb909a525abe28e563c8024a20d76e6c4658d Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sun, 13 Mar 2022 08:51:18 -0400 Subject: [PATCH] LibC: Use altzone for the current time zone offset during DST --- Userland/Libraries/LibC/time.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibC/time.cpp b/Userland/Libraries/LibC/time.cpp index 0390d2cbd7..58ed2dbc88 100644 --- a/Userland/Libraries/LibC/time.cpp +++ b/Userland/Libraries/LibC/time.cpp @@ -146,7 +146,7 @@ static time_t tm_to_time(struct tm* tm, long timezone_adjust_seconds) time_t mktime(struct tm* tm) { tzset(); - return tm_to_time(tm, timezone); + return tm_to_time(tm, daylight ? altzone : timezone); } struct tm* localtime(const time_t* t) @@ -162,7 +162,7 @@ struct tm* localtime_r(const time_t* t, struct tm* tm) if (!t) return nullptr; - time_to_tm(tm, *t - timezone); + time_to_tm(tm, *t - (daylight ? altzone : timezone)); return tm; }