From 820dc1fc534e7586dfe39a965728bca109748be3 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 14 Jan 2022 08:11:45 -0500 Subject: [PATCH] AK: Use appropriate types in AK::Time::from_timestamp factory Allow the provided year to be negative, and allow millisecond values larger than 255. --- AK/Time.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/Time.h b/AK/Time.h index f1a3f28b1d..645a9d67d0 100644 --- a/AK/Time.h +++ b/AK/Time.h @@ -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;