diff options
author | kleines Filmröllchen <filmroellchen@serenityos.org> | 2023-03-13 22:11:13 +0100 |
---|---|---|
committer | Jelle Raaijmakers <jelle@gmta.nl> | 2023-05-24 23:18:07 +0200 |
commit | 939600d2d4d2d04524301f4373d76dc3c693923a (patch) | |
tree | f290a9d0ae8ee366df2ba1c0066188cf7dbf189e /AK | |
parent | c1323febc28c4d21b555b2449ec7473dc1c0d568 (diff) | |
download | serenity-939600d2d4d2d04524301f4373d76dc3c693923a.zip |
Kernel: Use UnixDateTime wherever applicable
"Wherever applicable" = most places, actually :^), especially for
networking and filesystem timestamps.
This includes changes to unzip, which uses DOSPackedTime, since that is
changed for the FAT file systems.
Diffstat (limited to 'AK')
-rw-r--r-- | AK/DOSPackedTime.cpp | 6 | ||||
-rw-r--r-- | AK/DOSPackedTime.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/AK/DOSPackedTime.cpp b/AK/DOSPackedTime.cpp index f964db14d2..224db24c30 100644 --- a/AK/DOSPackedTime.cpp +++ b/AK/DOSPackedTime.cpp @@ -8,12 +8,12 @@ namespace AK { -Duration time_from_packed_dos(DOSPackedDate date, DOSPackedTime time) +UnixDateTime time_from_packed_dos(DOSPackedDate date, DOSPackedTime time) { if (date.value == 0) - return Duration(); + return UnixDateTime::from_unix_time_parts(first_dos_year, 1, 1, 0, 0, 0, 0); - return Duration::from_timestamp(first_dos_year + date.year, date.month, date.day, time.hour, time.minute, time.second * 2, 0); + return UnixDateTime::from_unix_time_parts(first_dos_year + date.year, date.month, date.day, time.hour, time.minute, time.second * 2, 0); } DOSPackedDate to_packed_dos_date(unsigned year, unsigned month, unsigned day) diff --git a/AK/DOSPackedTime.h b/AK/DOSPackedTime.h index dfce4114d8..1b55a0917a 100644 --- a/AK/DOSPackedTime.h +++ b/AK/DOSPackedTime.h @@ -33,7 +33,7 @@ static_assert(sizeof(DOSPackedDate) == 2); inline constexpr u16 first_dos_year = 1980; -Duration time_from_packed_dos(DOSPackedDate, DOSPackedTime); +UnixDateTime time_from_packed_dos(DOSPackedDate, DOSPackedTime); DOSPackedDate to_packed_dos_date(unsigned year, unsigned month, unsigned day); DOSPackedTime to_packed_dos_time(unsigned hour, unsigned minute, unsigned second); |