function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bob NagyBob Nagy 

Obvious SF bug or am I missing something

A simple format call on a datetime is return the wrong value.  A yaer that should be 2015 is coming back 2016.  Am I missing something?

Here is a simple 3 line code example that demonstrates the problem:
 
// Create a DateTime of December 27, 2015
datetime dtTemp = DateTime.newInstance(2015, 12, 27, 0,0,0);
// Format that Date Time - Should Be; December 27, 2015
String sFormatedDate = dtTemp.format('MMMM d, YYYY');
system.debug('++++++++++++++++++Formatted Date  = ' + sFormatedDate);
// Actual is coming back December 27,2016