mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibCore: Make DateTime::create() not fill in tm_wday and tm_yday for calling mktime()
This commit is contained in:
parent
459e4ace93
commit
221b412210
Notes:
sideshowbarker
2024-07-19 03:22:46 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/221b412210d Pull-request: https://github.com/SerenityOS/serenity/pull/3234
1 changed files with 1 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue