this post was submitted on 20 Nov 2023
1307 points (97.0% liked)
196
16591 readers
2883 users here now
Be sure to follow the rule before you head out.
Rule: You must post before you leave.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I'm not sure I would agree with that. ISO-8601 is ambiguous, and very difficult to parse. For example, here are a couple valid ISO-8601 strings. Could you let me know what they mean?
Taken from here. My favorite is the last one (
20
). If someone just wrote20
and told you to parse it using ISO-8601, what would you get? Hour? It could even be century (ie.2023%100
)!!So I would argue that ISO-8601 is just a wee bit too flexible. Personally, I like RFC 3339 just a bit more...
Edit: that said, I would definitely agree that something along the lines of
2021-07-27T14:20:32Z
is better than any regularly accepted alternative, and I pretty much format my dates that way all the time.to be fair, you don't parse "20" without first passing "%C"