Use
parseInt(date[1], 10)
to make sure the string is interpreted as base 10 (decimal).
Otherwise, it is interpreted as base 8 (octal) if it starts with "0"
, or as base 16 (hexadecimal) if it starts with "0x"
.
In fact, you should always include the base argument to avoid these kinds of bugs.