I have the following JavaScript: http://jsfiddle.net/5Hapw/
When selecting a date, a variable will alert to say the timestamp – however, on the 8th and 9th of any month, the timestamp is always wrong.
Can anyone see where I have gone wrong?
Thanks in advance.
If you don’t pass a second parameter to parseInt (the base) javascript will guess at it. It’s probably guessing wrong. Pass 10 in as the second param to all your parseInt calls (you can get rid of the code that truncates the zero from the month – incidentally adding this code to truncate the zero from the day of month would also work)
Updated fiddle: http://jsfiddle.net/5Hapw/4/