mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-18 14:09:42 +00:00
LibWeb/HTML: Use from_milliseconds_since_epoch
directly
Use `from_milliseconds_since_epoch` directly instead of converting to seconds first and calling `from_seconds_since_epoch`.
This commit is contained in:
parent
bd34b11ca2
commit
89f94845cf
Notes:
github-actions[bot]
2025-08-27 13:11:18 +00:00
Author: https://github.com/skyz1
Commit: 89f94845cf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5997
Reviewed-by: https://github.com/gmta ✅
1 changed files with 1 additions and 1 deletions
|
@ -2413,7 +2413,7 @@ static Utf16String convert_number_to_date_string(double input)
|
|||
// The algorithm to convert a number to a string, given a number input, is as follows: Return a valid
|
||||
// date string that represents the date that, in UTC, is current input milliseconds after midnight UTC
|
||||
// on the morning of 1970-01-01 (the time represented by the value "1970-01-01T00:00:00.0Z").
|
||||
auto date = AK::UnixDateTime::from_seconds_since_epoch(input / 1000.);
|
||||
auto date = AK::UnixDateTime::from_milliseconds_since_epoch(input);
|
||||
return date.to_utf16_string("%Y-%m-%d"sv, AK::UnixDateTime::LocalTime::No);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue