summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2020-08-20 15:46:11 -0400
committerAndreas Kling <kling@serenityos.org>2020-08-21 12:11:48 +0200
commit221b412210d823b912fae889c6b9fcf0870ae690 (patch)
tree820d89e47521ce8ad4b5e255523984980b472745 /Libraries
parent459e4ace93fb3d0ed40b4faed9835f5ed57795e2 (diff)
downloadserenity-221b412210d823b912fae889c6b9fcf0870ae690.zip
LibCore: Make DateTime::create() not fill in tm_wday and tm_yday for calling mktime()
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibCore/DateTime.cpp3
1 files changed, 1 insertions, 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;