Convert string to ISODate

Viewed 42780

How could I convert the string "2015-02-02" to ISODate 2015-02-02T00:00:00.000Z? I was trying to find some example but did not.

4 Answers
new Date("11/11/2019").toISOString()

or use it as a variable

mydate = "11/11/2019"
new Date(mydate).toISOString()
Related