15
rated 0 times
[
21]
[
6]
/ answers: 1 / hits: 18485
/ 15 Years ago, wed, january 6, 2010, 12:00:00
The string can be got by getFullYear and so on.
Can it be done reversely?
More From » date
The string can be got by getFullYear and so on.
Can it be done reversely?
Replace -
by /
and JavaScript can parse it. Stupid mistake in JS specification (ISO date/time standard is very clear that -
is correct)
var str = 2010-1-10;
alert(Date.parse(str.replace(/-/g,/)));
Try pasting it in your browser: javascript:alert(Date.parse(2010-01-01.replace(/-/g,/)));