I have date data being returned from a server in the following format through JSON
/Date(1139443200000)/
If I try to display this on a web browser using the following code snippet:
success: function( rows ) {
if( rows.d[0] ) {
$.each( rows.d, function( index, row ) {
$("div").append( row.OpenDate );
the date gets displayed on the screen like this:
/Date(1139443200000)/
How do I format this to display like this
09-02-2006
and
09-02-2006 - 00:00
OpenDate: "/Date(1139443200000)/". That's a fairly common way to send dates in JSON text, as JSON (incomprehensibly) has no concept of dates."OpenDate":"\/Date(1139443200000)\/"even in JSON. So how do I format that to display as required?new Date(number), where the number would be milliseconds since The Epoch UTC (or it could benew Date(year[, month[,...]])). And that was probably too language-specific. It's too bad, a lot of hassle could have been prevented by defining a simply-parsed subset of ISO-8601 with values being in UTC.