3 ms·
IIRC, ISO8601 isn't a single constant, fixed format. It's a variety of optional representations that generally follow the rule least-to-most specific. For examp
by paulryanrogers 8y ago
IIRC, ISO8601 isn't a single constant, fixed format. It's a variety of optional representations that generally follow the rule least-to-most specific. For example 19991231 would be as valid as 1999-12-31.
- Groxx 8y agoYeah, good point on 8601. But that's even more of a reason to use a pre-defined 8601-parser/printer/whatever instead of a hand-written format string. If you're using 8601 for an interchange format... don't. But if you're forced to emit a hard-coded format for whatever consumer can't be forced to do things sanely, this would be one of those exceptions to "most people". And it should immediately stop after that exception.
- bmn__ 8y agohttps://tools.ietf.org/html/rfc3339 https://tools.ietf.org/html/rfc3339 exists as a profile of ISO 8601 for precisely that reason, its representations are much more restricted.