Opposite method to toLocaleDateString
问题 In order to create a string that respects the browser culture, we can do: var myDate = new Date(); var myDateString = myDate.toLocaleDateString(myDate); //returns a string Which is nice, because if I'm in Portugal, for the 1st of June, this will output "01/06/2015", while if I'm on the states, it will output "06/01/2015". Now I want the exact opposite. I want: var myDateString = "01/06/2015" var myDate = myDateString.toLocaleDate(); //it should return a Date Any suggestions? 回答1: Browsers