We have used the java script function parseInt to parse the strings, however on the 9 th sept it started failing, I debugged the script and observed the following things :
var dt = parseInt("09"); // gives result as 0
var dt = parseInt("08"); // gives result as 0
var dt = parseInt("07"); // gives result as 7
solution is specify base 10
var dt = parseInt("09", 10); // gives result as 9
var dt = parseInt("08", 10); // gives result as 8
var dt = parseInt("07", 10 ); // gives result as 7
Reason : Both parseInt('08') and parseInt('09') return zero because the function tries to determine the correct base for the numerical system used. In Javascript numbers starting with zero are considered octal and there's no 08 or 09 in octal, hence the problem.
var dt = parseInt("09"); // gives result as 0
var dt = parseInt("08"); // gives result as 0
var dt = parseInt("07"); // gives result as 7
solution is specify base 10
var dt = parseInt("09", 10); // gives result as 9
var dt = parseInt("08", 10); // gives result as 8
var dt = parseInt("07", 10 ); // gives result as 7
Reason : Both parseInt('08') and parseInt('09') return zero because the function tries to determine the correct base for the numerical system used. In Javascript numbers starting with zero are considered octal and there's no 08 or 09 in octal, hence the problem.