tags:

views:

30

answers:

3

hi,

need Javascript equiv of php strtotime()..

thanks in advance...

A: 

I don't believe browsers have anything like this built in, but there are some good libraries available.

You might check out Datejs.

Alex JL
i used that library function strtotime(str, now) {........}var conclusion_dt="2008-07-12 18:11:22"var tmpdate = strtotime(conclusion_dt);plz give me the solution..but it returns Boolean value like false...I need Values like 11200530500...
theSun
+2  A: 

This should probably work. http://phpjs.org/functions/strtotime:554

Meher
+2  A: 

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?

djechelon
thank you so much djechelon
theSun