mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 10:08:10 +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
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…
Add table
Add a link
Reference in a new issue