-
Notifications
You must be signed in to change notification settings - Fork 16
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
Implement parsing offset without colon #204
Comments
FWIW, Temporal does support this:
|
Fair point. It definitely is "common", and I agree most users will expect it to be parsed. My only concern is of course that we need to draw the line somewhere about what ISO is parsed, and what isn't. yes yes slipperly slope but do we support...
@BurntSushi does Jiff draw the line at the same place as Temporal? |
Hmmm, do you know about Temporal's ISO 8601 grammar? That's what Jiff implements sans a few minor differences. The Temporal folks already did the (very) hard work of identifying the "good" parts of ISO 8601, while remaining compatible with RFC 3339 and RFC 9557. So I deferred strongly to them. But yes, Jiff supports this too. These assertions pass: use jiff::Timestamp;
fn main() -> anyhow::Result<()> {
let ts: Timestamp = "2025-02-07T07:44:00.000+01:00".parse()?;
assert_eq!(ts.to_string(), "2025-02-07T06:44:00Z");
let ts: Timestamp = "2025-02-07T07:44:00.000+0100".parse()?;
assert_eq!(ts.to_string(), "2025-02-07T06:44:00Z");
Ok(())
} |
And see also tc39/proposal-temporal#2843 |
I think the offset
+0100
is pretty close to+01:00
and one of the more common formats so this seems to be worth supportingThe text was updated successfully, but these errors were encountered: