Skip to content

Comment on Designing a REST API: Unix Time vs. ISO-8601 (2013)parent

Comments

Public APIs maybe. Internal? I'm not so sure. Since JSON doesn't have a time type, an ISO date field always requires validation and there are plenty of edge cases to consider (e.g. do you want to accept bare/naive datetimes, do you want to require all parts to be present, do you allow week dates, etc).

The biggest advantage of ISO 8601 is probably that you can also use it to represent dates and/or times rather than only datetimes but this can result in unnecessary ambiguity (e.g. if you decide to split the datetime into a date and a time field and make assumptions about the timezone).

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.