Skip to main content
Copy edited.
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

You can use this to get a date from jsonJSON:

var date = eval(jsonDate.replace(/\/Date\((\d+)\)\//gi, "new Date($1)"));

andAnd then you can use JavaScripta JavaScript Date Format script (1.2 KB when minified and gzipped) to display it as you want.

You can use this to get a date from json:

var date = eval(jsonDate.replace(/\/Date\((\d+)\)\//gi, "new Date($1)"));

and then you can use JavaScript Date Format script (1.2 KB when minified and gzipped) to display it as you want.

You can use this to get a date from JSON:

var date = eval(jsonDate.replace(/\/Date\((\d+)\)\//gi, "new Date($1)"));

And then you can use a JavaScript Date Format script (1.2 KB when minified and gzipped) to display it as you want.

Post Made Community Wiki by Venemo
Source Link
Panos
  • 19.2k
  • 6
  • 48
  • 55

You can use this to get a date from json:

var date = eval(jsonDate.replace(/\/Date\((\d+)\)\//gi, "new Date($1)"));

and then you can use JavaScript Date Format script (1.2 KB when minified and gzipped) to display it as you want.