diff options
author | Timothy Flynn <trflynn89@pm.me> | 2022-01-10 22:41:40 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-01-11 23:56:35 +0100 |
commit | 5aa144193c095056f4ef9cb823ffbed67bd56b36 (patch) | |
tree | 1072a611e179e04508158322a36846cb0ed311e8 /Meta/Lagom/Tools | |
parent | 2b5840296a86dfd7096596b675218ca92e1660f3 (diff) | |
download | serenity-5aa144193c095056f4ef9cb823ffbed67bd56b36.zip |
LibTimeZone: Use new AK::Time factory method in generated code
Diffstat (limited to 'Meta/Lagom/Tools')
-rw-r--r-- | Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp index 1f1b093741..325a280ada 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp @@ -267,22 +267,11 @@ static void generate_time_zone_data_implementation(Core::File& file, TimeZoneDat namespace TimeZone { -static constexpr auto seconds_per_day = 86'400; -static constexpr auto seconds_per_hour = 3'600; -static constexpr auto seconds_per_minute = 60; - struct DateTime { AK::Time time_since_epoch() const { // FIXME: This implementation does not take last_weekday or after_weekday into account. - i64 seconds_since_epoch = AK::days_since_epoch(year, month, day); - seconds_since_epoch *= seconds_per_day; - - seconds_since_epoch += hour * seconds_per_hour; - seconds_since_epoch += minute * seconds_per_minute; - seconds_since_epoch += second; - - return AK::Time::from_seconds(seconds_since_epoch); + return AK::Time::from_timestamp(year, month, day, hour, minute, second, 0); } u16 year { 0 }; |