The functions you list essentially report the time in different timezones, so to have a case where getUTCFullYear()
will differ from getFullYear()
it will be on evening of the 31st December if you live West of the Greenwich Meridian.
For example, in you local timezone the time could be 9pm but in UTC it might already be 2am on 1st January so:
var d = new Date();
d.getFullYear() == 2009 //True
d.getUTCFullYear() == 2010 //True
It is confusing since the methods operate on a Date
object rather than reporting the current UTC time. But the method says, if this is the time here, what year is it in the UTC timezone. So for 364.75 days of the years reported by the two methods will be the same.