1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 03:25:07 +00:00
serenity/Userland/Libraries/LibTimeZone
Timothy Flynn c3fd4554a6 LibTimeZone: Do not use tzname to determine the current time zone
The tzname array stores the abbreviated names of the current time zone
when in standard and daylight time. These abbreviations are ambiguous;
a single abbreviation often maps to multiple time zones. For example,
EST is used by America/New_York and America/Detroit, and CST could be
the abbreviation of Central Standard Time or China Standard Time.

Instead, we mimic a subset of how both ICU and Howard Hinnant's "date"
library determines the current time zone. First, we try to parse the TZ
environment variable. If that fails, or isn't set, we try to resolve the
/etc/localtime symbolic link. On most Linux systems and on macOS, this
is a link to the current TZDB file in use.

If all of the above fails, we fall back to UTC.
2022-09-28 23:52:51 +01:00
..
CMakeLists.txt Meta+Userland: Add ENABLE_USERSPACE_COVERAGE_COLLECTION CMake option 2022-05-02 01:46:18 +02:00
Forward.h LibTimeZone: Parse and generate a list of time zones used by region 2022-07-06 16:56:42 +02:00
TimeZone.cpp LibTimeZone: Do not use tzname to determine the current time zone 2022-09-28 23:52:51 +01:00
TimeZone.h LibTimeZone: Parse and generate a list of time zones used by region 2022-07-06 16:56:42 +02:00