I’ve created this JSFiddle to illustrate my question.
It seems that 10 – 00 = 8 in this example.
The simple question: Why does #ha contain 8? Have I misunderstood something?
var a4 = new Date(2012,00,00,00,00,00,0010);
var b4 = new Date(2012,00,00,00,00,00,0000);
var c4 = a4-b4;
var d4 = document.getElementById("ha");
d4.innerHTML=c4;
When an integer literal starts with
0it is interpreted as an octal literal, not a decimal literal. The literal0010has the same value as the literal8. Remove the leading zeroes.