summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibTimeZone
AgeCommit message (Collapse)Author
2022-02-03LibTimeZone: Parse and generate time zone coordinate dataTimothy Flynn
2022-01-31Everywhere: Update copyrights with my new serenityos.org e-mail :^)Timothy Flynn
2022-01-25LibTimeZone+Userland: Rename current_time_zone to system_time_zoneTimothy Flynn
This renames the current implementation of current_time_zone to system_time_zone to more clearly indicate what it is. Then reimplements current_time_zone to return whatever was set up by tzset, falling back to UTC if something went awry, for convenience.
2022-01-25LibTimeZone: Add an API to retrieve both daylight and standard offsetsTimothy Flynn
This API will also include the formatted name of the time zone, with respect for DST (e.g. EST vs EDT for America/New_York).
2022-01-23LibTimeZone: Use /etc/timezone as the basis for the system time zoneTimothy Flynn
This changes LibTimeZone to read the current time zone from the file /etc/timezone rather than using tzset/tzname. Instead, in a subsequent commit, LibC's time methods will be changed to used LibTimeZone to retrieve the system time zone. Also add an API to set the system time zone. This method is only allowed when running within Serenity.
2022-01-23LibTimeZone: Add an API to retrieve a list of all known IANA time zonesTimothy Flynn
2022-01-23DynamicLoader+LibC+LibTimeZone: Include LibTimeZone sources in LibCTimothy Flynn
LibTimeZone will be needed directly within LibC for functions such as localtime(). This change adds LibTimeZone directly within LibC, so that LibTimeZone isn't its own .so library anymore. LibTimeZone itself is compiled as an object library to make it easier to give it generator-specific compilation flags.
2022-01-19LibJS+LibTimeZone+LibUnicode: Indicate whether a time zone is in DSTTimothy Flynn
Return whether the time zone is in DST during the provided time from TimeZone::get_time_zone_offset,
2022-01-19LibTimeZone: Begin parsing and generating DaylightSavings rulesTimothy Flynn
2022-01-15LibTimeZone: Canonicalize the current time zone and fall back to UTCTimothy Flynn
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.
2022-01-12LibTimeZone: Add an API to retrieve the system's current time zoneTimothy Flynn
This is a wrapper API around the POSIX tzset / tzname information. It is to help ensure that tzset is invoked before accessing tzname.
2022-01-11LibTimeZone: Operate in UTC-only mode when !ENABLE_TIME_ZONE_DATALinus Groh
Instead of only having dummy functions that don't work with any input, let's at least support one time zone: 'UTC'. This matches the basic Temporal implementation for engines without ECMA-262, for example.
2022-01-11LibTimeZone: Begin generating GMT offset rules for each time zoneTimothy Flynn
This is a rather naive implementation, but serves as a first pass at determining the GMT offset for a time zone at a particular point in time. This implementation ignores DST (because we are not parsing any RULE entries yet), and ignores any offset patterns of the form "Mon>4" or "lastSun".
2022-01-11LibTimeZone: Add methods to canonicalize a time zone nameTimothy Flynn
2022-01-11LibTimeZone: Add method to convert a time zone to a stringTimothy Flynn
2022-01-11LibTimeZone: Do not separate the generated data from the main libraryTimothy Flynn
This CMakeLists.txt was basically copy-pasted from LibUnicode, where the generated data is separated into its own library. This was to let other libraries / applications decide if they actually want to link the data because it is so large. LibTimeZone's generated data is significantly smaller, so this separation really isn't needed.
2022-01-08LibTimeZone: Parse ZONE entries from the TZDB and generate their namesTimothy Flynn
2022-01-08LibTimeZone+Meta: Add plumbing for an IANA Time Zone Database generatorTimothy Flynn
The IANA Time Zone Database contains data needed, at least, for various JavaScript objects. This adds plumbing for a parser and code generator for this data. The generated data will be made available by LibTimeZone, much like how UCD and CLDR data is available through LibUnicode.