mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
AK: Use appropriate types in AK::Time::from_timestamp factory
Allow the provided year to be negative, and allow millisecond values larger than 255.
This commit is contained in:
parent
67473085a1
commit
820dc1fc53
Notes:
sideshowbarker
2024-07-17 20:53:11 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/820dc1fc534 Pull-request: https://github.com/SerenityOS/serenity/pull/11891
1 changed files with 1 additions and 1 deletions
|
@ -136,7 +136,7 @@ private:
|
|||
}
|
||||
|
||||
public:
|
||||
[[nodiscard]] constexpr static Time from_timestamp(u16 year, u8 month, u8 day, u8 hour, u8 minute, u8 second, u8 millisecond)
|
||||
[[nodiscard]] constexpr static Time from_timestamp(i32 year, u8 month, u8 day, u8 hour, u8 minute, u8 second, u16 millisecond)
|
||||
{
|
||||
constexpr auto milliseconds_per_day = 86'400'000;
|
||||
constexpr auto milliseconds_per_hour = 3'600'000;
|
||||
|
|
Loading…
Reference in a new issue