-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Proposed clocks improvements #71
base: main
Are you sure you want to change the base?
Commits on Jul 10, 2024
-
Rename "instant" to "monotonic-clock-point"
Other possibilities: "monotonic-time", "clock-point" (if the "monotonic-clock" namespace is sufficient and we don't need to repeat 'monotonic'), "timestamp". Also renames monotonic-clock::subscribe-instant to subscribe-clock-point. Other possibilities: "subscribe-monotonic-clock-point", "subscribe-time", "subscribe-monotonic-time", "subscribe-timestamp".
Configuration menu - View commit details
-
Copy full SHA for 8c12295 - Browse repository at this point
Copy the full SHA 8c12295View commit details -
Rename "wall-clock" to "system-clock"
Other possibilities: "system-time", "exact-clock", "exact-time", "current-time", etc. I propose "system-clock" because referring to it as a clock makes sense, within the WASI Clocks interface.
Configuration menu - View commit details
-
Copy full SHA for e4521a3 - Browse repository at this point
Copy the full SHA e4521a3View commit details
Commits on Jul 11, 2024
-
Rename "datetime" to "instant"
Other possibilities: "system-clock-point", "clock-point" (analogous to "monotonic-clock-point"), "exact-time", "absolute-time", "timestamp", "epoch-time".
Configuration menu - View commit details
-
Copy full SHA for 13f62d1 - Browse repository at this point
Copy the full SHA 13f62d1View commit details -
Remove "in-daylight-saving-time" flag
This flag is problematic because when a time zone is "in DST" is not well defined. Most time zones in the world don't use DST at all. Of the ones that do, most go to DST during the summer for half the year, but not all. For example, the function in Moment.js that provides this functionality comes with a giant caveat: https://momentjs.com/docs/#/query/is-daylight-saving-time/
Configuration menu - View commit details
-
Copy full SHA for 3921fca - Browse repository at this point
Copy the full SHA 3921fcaView commit details -
Rename "timezone-display::name" to "id"
Other possibilities: "tzid", "iana-id", "identifier", "iana-identifier". Returning a user-displayable name as part of timezone-display would require more information: the user's preferred language, and the preferred style for the name: - abbreviated or not - year-round or specific to the Instant E.g., the time zone with the IANA id "America/Los_Angeles" might be displayed as "Pacific Time", "Pacific Standard Time", "Pacific Daylight Time", "PT", "PST", "PDT", "Nordamerikanische Westküstenzeit"... The Rust iana_time_zone crate uses IANA time zone IDs, so if this interface needs to be able to implement iana_time_zone, timezone-display should have an IANA ID and not a user-displayable name.
Configuration menu - View commit details
-
Copy full SHA for 0ced9d5 - Browse repository at this point
Copy the full SHA 0ced9d5View commit details -
Measure UTC offset in nanoseconds
There are time zones that used sub-minute or even sub-second UTC offsets for instants in the past. E.g., when built using Vanguard format, the UTC offset in the TZDB for "Asia/Ho_Chi_Minh" before July 1906 is 7:06:30.133333333.
Configuration menu - View commit details
-
Copy full SHA for b21c4a5 - Browse repository at this point
Copy the full SHA b21c4a5View commit details -
Refactor timezone-display into separate methods
If the timezone-display ID is an IANA ID, and we are going with the approach of not making the localized ("PST" vs "PDT" vs "PT") name part of this component, then the current time zone doesn't depend on the current time. After removing the isDST flag, timezone-display contains two pieces of data, the ID and the UTC offset. The UTC offset is already available via a function that takes an Instant as input. The ID could just be available via its own function that doesn't take any input. In that case there would be no need for timezone-display.
Configuration menu - View commit details
-
Copy full SHA for 205bdc8 - Browse repository at this point
Copy the full SHA 205bdc8View commit details