VJS VJS - 1 year ago 140
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?

Answer Source

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?