March 7, 2012
Convert date string to date
Question by oshirowanen
I have a string Mar 7 2012
.
How do I convert this to a Date object, so I can use mydate.getDate()
, mydate.getMonth()
, mydate.getFullYear()
etc?
Answer by Starx
Well, Its pretty simple
var d =new Date("March 7 2012");
document.write(d.getMonth()); //use it