1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:24:57 +00:00

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.)
This commit is contained in:
Timothy Flynn 2022-10-17 12:46:51 +00:00 committed by Linus Groh
parent ed612d835d
commit b1b17f286f

View file

@ -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;