How to format the current date as JSON in JavaScript

1 Answer

0 votes
let json = JSON.stringify({'now': new Date()}) ; 

console.log(json);
 
 
 
 
/*
run:
 
{"now":"2021-02-04T10:17:13.810Z"}
 
*/

 



answered Feb 4, 2021 by avibootz

Related questions

1 answer 273 views
1 answer 140 views
2 answers 233 views
1 answer 194 views
3 answers 301 views
2 answers 224 views
...