3 ms·
ISO-8601 was a good early attempt, but unfortunately it has some negative points: - Only offset-based time zones are allowed (which are next to useless). - Om
by kstenerud 6y ago
ISO-8601 was a good early attempt, but unfortunately it has some negative points:
- Only offset-based time zones are allowed (which are next to useless).
- Omitting the time zone defaults to local time, which renders the time ambiguous. Defaulting to UTC makes much more sense.
- BC dates are all offset by 1 ("-1" = 2 BC). I know the reasons for this, but this could have been moved to the implementation and not exposed to the user.
- Lots of silly things like fractional-minutes and multiple ways to represent the same data bloat the spec and implementations.
This is why I rejected iso-8601 and developed my own for https://github.com/kstenerud/concise-encoding/blob/master/cte-specification.md#temporal-types https://github.com/kstenerud/concise-encoding/blob/master/ct...
Examples:
2019-8-5 : August 5, 2019
-300-12-21 : December 21, 300 BC (proleptic Gregorian)
12:05:50.102 : 12:05:50 and 102 milliseconds UTC
4:00:00/Asia/Tokyo : 4:00:00 Tokyo time
2019-01-23/14:08:51.941245 : January 23, 2019, at 14:08:51 and 941245 microseconds, UTC
1985-10-26/01:20:01.105/America/Los_Angeles : October 26, 1985, at 1:20:01 and 105 milliseconds, Los Angeles time
25192-11-01/03:00:00/48.86/2.36 : November 1st, 25192, at 3:00:00, at whatever is in the place of Paris at that time (global coordinates 48.86, 2.36)