VJS VJS - 5 months ago 41x
Javascript Question

Javascript equivalent of php's strtotime()?

In PHP, you can easily convert an English textual datetime description into a proper date with


Is there anything similar in Javascript?


I found this article and tried the tutorial. Basically, you can use the date constructor to parse a date, then write get the seconds from the getTime() method

var d=new Date("October 13, 1975 11:13:00");
document.write(d.getTime() + " milliseconds since 1970/01/01");

Does this work?