For the JSON date format, I’ve seen a lot of various standards:
Which option is the correct one? Or is it better? Is there a set of rules for this?
Asked by Kamyar Nazeri
The format returned by Date’s toJSON function should be used:
That said, “milliseconds since 1970” is understood by every date library ever developed. ThiefMaster is the best choice for portability.
Answered by funroll
JSON isn’t aware of the concept of dates. What.NET does is a hack/extension that isn’t standard.
Answered by ThiefMaster
There is no one-size-fits-all format for sharing dates; the JSON specification does not provide one, which is why there are so many distinct approaches.
The optimum format is probably a date in ISO 8601 format (see Wikipedia); it’s a well-known and extensively used format that can be handled in a variety of languages, making it ideal for interoperability. Choosing 8601 as the date interchange format is a suitable choice if you have control over the generated json, for example, if you provide data to other systems in json format.
If you don’t have control over the generated json, such as if you’re a consumer of json from multiple distinct systems, having a date parsing utility function to handle the various forms required is the best way to go.
Answered by Russ Cam
The I-JSON Message Format (RFC 7493) states:
Depending on who you ask, I-JSON stands for either Internet JSON or Interoperable JSON.
Answered by Bryan Larsen
Answered by Shayan Ahmad
Post is based on https://stackoverflow.com/questions/10286204/what-is-the-right-json-date-format