4 ms·
So do tons of other libraries and PL standard libraries. jodatime in Java, moment.js, JS' Date object, python's datetime stdlib module, python-dateutil etc. ISO
by wyuenho 14y ago
So do tons of other libraries and PL standard libraries. jodatime in Java, moment.js, JS' Date object, python's datetime stdlib module, python-dateutil etc. ISO-8601 is actually quite a difficult standard to program for. 9 out of 10 times, these libraries either don't support just year, year-month, or both. 9 out of 10 times, when a datetime object is formatted to a string, you see inconsistencies about that dangling Z marker at the end.
Tom Morris is right, they all suck when it comes to ISO-8601 support.
- eCa 14y agoI wonder how Perl's DateTime::Format::ISO8601 [1] holds up... [1] https://metacpan.org/module/DateTime::Format::ISO8601 https://metacpan.org/module/DateTime::Format::ISO8601
- draegtun 14y agoSeems to be fine: $ re.pl >> use aliased 'DateTime::Format::ISO8601'; >> ISO8601->parse_datetime("2012-012"); 2012-01-12T00:00:00 >> ISO8601->parse_datetime("2012-366"); 2012-12-31T00:00:00 >> ISO8601->parse_datetime("2012-12"); 2012-12-01T00:00:00 >> ISO8601->parse_datetime("2012"); 2012-01-01T00:00:00 And if it isn't then there is also Date::ISO8601 [1] which is written by Zefram [2] who is renowned for being a Date/Time nut [3] :) 1 - https://metacpan.org/module/Date::ISO8601 https://metacpan.org/module/Date::ISO8601 2 - https://metacpan.org/author/ZEFRAM https://metacpan.org/author/ZEFRAM 3 - https://metacpan.org/module/Date::Darian::Mars https://metacpan.org/module/Date::Darian::Mars