summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-10-17 12:46:51 +0000
committerLinus Groh <mail@linusgroh.de>2022-10-17 21:50:55 +0200
commitb1b17f286f01667816f2ac00fc2c73fc43b561d8 (patch)
tree679d1159e1d38f3dc88cc3621cfdfdb1c276d2ce
parented612d835db151b4a69d1ec3640d00ed9a9a1077 (diff)
downloadserenity-b1b17f286f01667816f2ac00fc2c73fc43b561d8.zip
LibC: Retrieve the current time zone from LibTimeZone
This ensures we have just one location for determining the time zone, so that LibC and LibTimeZone will behave the same. (Note the FIXME removed here is also in TimeZone::current_time_zone.)
-rw-r--r--Userland/Libraries/LibC/time.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/Userland/Libraries/LibC/time.cpp b/Userland/Libraries/LibC/time.cpp
index a1591c8051..2c93bcbe3d 100644
--- a/Userland/Libraries/LibC/time.cpp
+++ b/Userland/Libraries/LibC/time.cpp
@@ -397,12 +397,7 @@ size_t strftime(char* destination, size_t max_size, char const* format, const st
void tzset()
{
- // FIXME: Actually parse the TZ environment variable, described here:
- // https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08
- if (char* tz = getenv("TZ"); tz != nullptr)
- __tzname = { tz, strlen(tz) };
- else
- __tzname = TimeZone::system_time_zone();
+ __tzname = TimeZone::current_time_zone();
auto set_default_values = []() {
timezone = 0;