I can not find the reason for this behavior
<script>
function myFunction()
{
var d1 = Date.parse("02/11/2014");
var d2 = Date.parse("2014-02-11");
var x = document.getElementById("demo");
x.innerHTML=d1+"---------"+d2+"<br/>"+new Date(d1)+"----"+"<br/>"+new Date(d2);
}
</script>
EXIT:
1392057000000 --------- 1392076800000
Tuesday February 11, 2014 00:00:00 GMT + 0530 (IST)
Tuesday 11 Feb 2014 05:30:00 GMT + 0530 (IST)
Why does this give a different time when I pass the same date to Date.parse ()?
JSBIN shared: http://jsbin.com/IfufAToX/1/
source
share