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:
parent
ed612d835d
commit
b1b17f286f
1 changed files with 1 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue