From bb1f6f71f1c1efc675958390a52a9e52d9a9fd7b Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 27 Dec 2022 13:24:08 -0500 Subject: [PATCH] LibC: Make timegm() force tm_isdst to 0 UTC is not affected by summer time, and the BSD manpage for timegm() says "The tm_isdst [...] members are forced to zero by timegm()." --- Userland/Libraries/LibC/time.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Libraries/LibC/time.cpp b/Userland/Libraries/LibC/time.cpp index aab3884f5f..b771e5799c 100644 --- a/Userland/Libraries/LibC/time.cpp +++ b/Userland/Libraries/LibC/time.cpp @@ -214,6 +214,7 @@ struct tm* localtime_r(time_t const* t, struct tm* tm) time_t timegm(struct tm* tm) { + tm->tm_isdst = 0; return tm_to_time(tm, { __utc, __builtin_strlen(__utc) }); }