How to convert date to string formatted as JSON in JavaScript

1 Answer

0 votes
var d = new Date();  

var s = d.toJSON();

document.write(s);
 
/*
run:

2015-06-14T08:30:22.142Z  
 
*/

 



answered Jun 14, 2015 by avibootz
...