mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibJS: Create 1970-01-01 00:00:00 local time Date for invalid ctor call
When using Core::DateTime::from_timestamp(0) the resulting Date is 1970-01-01 00:00:00 in UTC, which might be something different in local time - this is incorrect and relevant as invalid Dates can be made valid later on.
This commit is contained in:
parent
ff5aa3ca70
commit
ba9d3bc38c
Notes:
sideshowbarker
2024-07-18 12:45:00 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/ba9d3bc38c9 Pull-request: https://github.com/SerenityOS/serenity/pull/7846
1 changed files with 1 additions and 1 deletions
|
@ -159,7 +159,7 @@ Value DateConstructor::construct(Function&)
|
|||
}
|
||||
|
||||
auto create_invalid_date = [this]() {
|
||||
auto datetime = Core::DateTime::from_timestamp(static_cast<time_t>(0));
|
||||
auto datetime = Core::DateTime::create(1970, 1, 1, 0, 0, 0);
|
||||
auto milliseconds = static_cast<u16>(0);
|
||||
return Date::create(global_object(), datetime, milliseconds, true);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue