I researched about converting date
into string
in ISO format, and I found two methods to do that giving me the same result '2022-07-29T06:46:54.085Z'
:
(new Date()).toISOString()
JSON.parse(JSON.stringify(new Date()))
Question:
- Does
JS
make two approaches/algorithms of converting date or just one function code just call on different objectJSON
orDate
, If So Which one is the best to use?
Comments
Post a Comment