I want to convert the date object to string but I want it in the same format as it is displayed when I do console.log(new Date())
which is something like '2019-05-21T11:55:39.496Z' and not the usual extended format we get when we do console.log(new Date().toString())
which is something like this 'Tue May 21 2019 17:28:51 GMT+0530 (India Standard Time)'.
Asked
Active
Viewed 73 times
-3

nishchayp
- 1
- 1
-
1https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString – ADyson May 21 '19 at 12:04
-
Duplicate of https://stackoverflow.com/questions/15257911/create-an-iso-date-object-in-javascript – str May 21 '19 at 12:08