Hi - I'm writing a app that exposes a REST API. Some of the query parameters will be date/time (accurate to second), and some of the responses will be timestamps (accurate to millisecond).
The API implementation on the server is in Java. The client apps can be anything - java, javascript, .NET. The API returns XML or JSON data. Date/Time data is stored in a Oracle database.
Does anyone have recommendations, based on prior pain, of what the best format format is for passing these date/time values. I'm thinking myself to just use a good old fashioned long to store the number of milliseconds since January 1, 1970, 00:00:00 GMT.
Edit The date range covered in the API is for real time events, so there will be nothing before 2010, and (setting myself up for abuse here) nothing after 2038.
I guess best would be determined by
a) Wide variety of languages support converting this long into internal date object, without having to write code to do it.
b) Lowest CPU overhead (on server app)