8 ms·
Why not just use Unix time (in milliseconds) for your timestamps? You'll have to convert it to whatever your desired container format is on the other end of the
by ender7 14y ago
Why not just use Unix time (in milliseconds) for your timestamps? You'll have to convert it to whatever your desired container format is on the other end of the wire, but...you're going to have to do that for all of your other data as well.
- ominous_prime 14y agoIt would be ambiguous, since you need to know what timezone the timestamp is from. This is why most applications use ISO8601.
- Cushman 14y agoUnix time is always UTC, isn't it?
- ominous_prime 14y agoYeah, it is. I was thinking that since it just a raw number of seconds with no TZ designation, that there's too much room for incorrect implementations using localtime.
- olavk 14y agoSure. Or you can use one of the ISO 8601 date formats encoded as a string. Or the special string "\/Date(...)\/" which some JSON libraries have chosen. The problem is not to encode a date, the problem is there is no agreed way to do it, so you can't be sure that the other end actually receive a date.