getYear()
is deprecated and is replaced by getFullYear()
getYear()
is working for IE8, but it is broken for IE10.
For the Date object created by new Date("10/10/2013")
, when you use getYear()
IE8 returns 2013, but IE10 returns 113.
Inorder to get the 4-digit year value, you need to use the getFullYear()
function.