I'm trying to convert a date in javascript from MM/dd/yyyy to yyyy/MM/dd

so this **works**:

```
var d = new Date("08/08/2012");
dateString = d.getFullYear() + "/" + d.getMonth() + "/" + d.getDate();
document.write(dateString);

```

output = 2012/7/8

///////////////////////////////////////////////////

this does **not**:

```
var dateString = "08/08/2012";
var d = new Date(dateString);
dateString = d.getFullYear() + "/" + d.getMonth() + "/" + d.getDate();
document.write(dateString);

```

and **neither does this**:

```
var dateString = "08/08/2012";
var d = Date.parse(dateString);
dateString = d.getFullYear() + "/" + d.getMonth() + "/" + d.getDate();
document.write(dateString);

```

how do I make it work with a string variable? thanks

~Myy