However, the date object ends up being 24th December 2005!!!!
Why does this happen? Well there is a 'bug' in parseInt that means that if you
use it to convert a string with a leading zero, it assumes it is dealing with
OCTAL (base 8) numbers : 08 and 09 are therefore not valid numbers, so parseInt
returns zero. Zero is January, so when your code then subtracts -1 it becomes
December of the previous year!! I won't go into great detail with regard to the
swearing involved in tracking this one down....
The fix for this is very simple: you simply tell parseInt that you are working
in base 10 like this: