I have been experiencing a strange issue since Dec 27. When I try to format a date to a string, it is giving me next year date. When I executed this in Workbench, I find that the
formatGmt() method of Datetime class is actually giving me next year’s date.
So, in results, I am getting the date as
2015-12-29T11:59:12.988Z but the corresponding string date (using YYYYMMdd) format is
This was working fine till Dec 27 and there has been no change to the underlying code.
I read the specs of the formatGmt method again – am I missing something obvious here?