From 221b412210d823b912fae889c6b9fcf0870ae690 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Thu, 20 Aug 2020 15:46:11 -0400 Subject: [PATCH] LibCore: Make DateTime::create() not fill in tm_wday and tm_yday for calling mktime() --- Libraries/LibCore/DateTime.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Libraries/LibCore/DateTime.cpp b/Libraries/LibCore/DateTime.cpp index 2b6704f1e8..0becb62acd 100644 --- a/Libraries/LibCore/DateTime.cpp +++ b/Libraries/LibCore/DateTime.cpp @@ -53,8 +53,7 @@ DateTime DateTime::create(unsigned year, unsigned month, unsigned day, unsigned tm.tm_mday = (int)day; tm.tm_mon = (int)month - 1; tm.tm_year = (int)year - 1900; - tm.tm_wday = (int)dt.weekday(); - tm.tm_yday = (int)dt.day_of_year(); + // mktime() doesn't read tm.tm_wday and tm.tm_yday, no need to fill them in. dt.m_timestamp = mktime(&tm); return dt;