mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
LibTimeZone: Canonicalize the current time zone and fall back to UTC
If the tzname is unknown, fall back to UTC for now. Unknown time zones are most likely due to not parsing RULE entries yet, but at the very least, it only makes sense for current_time_zone to return a time zone that LibTimeZone actually knows about.
This commit is contained in:
parent
094b88e6a5
commit
247caac7a8
1 changed files with 1 additions and 1 deletions
|
@ -28,7 +28,7 @@ StringView current_time_zone()
|
|||
tzset();
|
||||
}
|
||||
|
||||
return tzname[0];
|
||||
return canonicalize_time_zone(tzname[0]).value_or("UTC"sv);
|
||||
}
|
||||
|
||||
Optional<TimeZone> __attribute__((weak)) time_zone_from_string([[maybe_unused]] StringView time_zone)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue