[SalesForce] How to display only month and year in a custom date field in vf page

I want to know how we can implement a custom date field in vf page which will display only month and year.

Regards

Best Answer

Use this.. instead {!now()} pass your custom field {!CutomObject.FieldAPIName__c}

<apex:outputText value="{0, date, MMMM','  yyyy}">
      <apex:param value="{!now()}" /> 
</apex:outputText>

Output

enter image description here

Related Topic