What is a preferred string format for dates in a REST API

api, date, http, rest

Solution

ISO8601 looks much more useful. From this document (containing a number of documented formats, usages and pros/cons):

- It is familiar to most developers

- It is unambiguous

- When sorted as a string of characters or as a string of octets they will be sorted as if they had been sorted as datetimes.

Problem

What is the preferred string format for dates when it comes to REST APIs, for both request and response data? I am considering ISO 8601 or RFC 1123: ``` ISO 8601: 2008-02-01T09:00:22+05:00 RFC 1123: Mon, 10 Dec 2012 14:25:01 GMT ``` What are the pro's and con's for each? Is there another alternative? What formats are other popular REST APIs using?

Original source