Print this page

Year in date field incorrect when rendered as output in Visualforce PDF

Knowledge Article Number 000206537
Resolution
The year in the date field will be rendered incorrectly when the date format is using a capital letter for the year value. 
 
<apex:outputText value="{0, date, MMMM dd',' YYYY}">


Versus
 
<apex:outputText value="{0, date, MMMM dd',' yyyy}">

 

Make sure you use the date patterns as described in the following table, taking into account the case letters:

 




promote demote