Last Updated: December 26, 2018
·
1.217K
· jisaacks

JavaScript Gotcha

If you are in the U.S. execute this JavaScript:

alert(new Date("2012-01-01").getFullYear());

Want to know why it returns 2011? Read my article

1 Response
Add your response

Nice gotcha. I appreciate that you gave a little intro on the Coderwall post and not just a link to your blog. I am seeing that a fair amount lately.

over 1 year ago ·