(no title)
epiceric | 4 months ago
Making them part of the language would increase the complexity of parsers - how would you validate that a date is actually valid? It's doable (YAML and TOML do it, after all) but requires extra steps.
epiceric | 4 months ago
Making them part of the language would increase the complexity of parsers - how would you validate that a date is actually valid? It's doable (YAML and TOML do it, after all) but requires extra steps.
epiceric|4 months ago
jitl|4 months ago
MDN page on JavaScript's Temporal library gives a good overview of the difference between the two; today's practice of encoding Instants as ISO 8601 strings in UTC (Z suffix) or at a UTC offset is okay for ephemeral data-in-motion that will be used right now, but is not a good practice for persisted data since time zones, DST rules, etc change all the time. Temporal is the JS-specific API, but these concepts apply to all handling of date/time/etc data in computer systems.
That said, v8 plans to use [temporal_rs][] as their Temporal backend.
Temporal: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
temporal_rs: https://crates.io/crates/temporal_rs
You can encode extended ZonedDateTime information to string following this RFC [Date and Time on the Internet: Timestamps with Additional Information](https://www.rfc-editor.org/rfc/rfc9557.txt)
djfobbz|3 months ago