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 369 views
1 answer 226 views
2 answers 347 views
1 answer 282 views
3 answers 456 views
2 answers 352 views
...