mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02: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:
committed by
Jelle Raaijmakers
parent
bd34b11ca2
commit
89f94845cf
Notes:
github-actions[bot]
2025-08-27 13:11:18 +00:00
Author: https://github.com/skyz1 Commit: https://github.com/LadybirdBrowser/ladybird/commit/89f94845cf8 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5997 Reviewed-by: https://github.com/gmta ✅
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user