diff options
author | Timothy Flynn <trflynn89@pm.me> | 2022-01-24 15:26:11 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-01-25 18:39:36 +0000 |
commit | cd0e5ccd3f9c0f7d92e140c332700ccde41b396a (patch) | |
tree | fb572c2968def5292a5019166e8f91789a53774e /Userland/Libraries/LibC/time.cpp | |
parent | 11f1f04a4ccc2bc03f6180dfbe9dd553c5706c9a (diff) | |
download | serenity-cd0e5ccd3f9c0f7d92e140c332700ccde41b396a.zip |
LibC: Revert localtime_r to use time zone information set by tzset
Now that tzset actually detects time zones, parties interested in time
zone offsets should invoke tzset.
Diffstat (limited to 'Userland/Libraries/LibC/time.cpp')
-rw-r--r-- | Userland/Libraries/LibC/time.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/Userland/Libraries/LibC/time.cpp b/Userland/Libraries/LibC/time.cpp index cf99be868a..728c01a075 100644 --- a/Userland/Libraries/LibC/time.cpp +++ b/Userland/Libraries/LibC/time.cpp @@ -162,13 +162,7 @@ struct tm* localtime_r(const time_t* t, struct tm* tm) if (!t) return nullptr; - auto time_zone = TimeZone::current_time_zone(); - auto time = AK::Time::from_seconds(*t); - - if (auto offset = TimeZone::get_time_zone_offset(time_zone, time); offset.has_value()) - time += AK::Time::from_seconds(offset->seconds); - - time_to_tm(tm, time.to_seconds()); + time_to_tm(tm, *t - timezone); return tm; } |