+1 vote
1 view
in Salesforce by (11.9k points)

In Salesforce, if I'm binding a date into a VisualForce page, how do I apply custom formatting to it?

Example:

<apex:page standardController="Contact">

  <apex:pageBlock title="Test">

      <p>{!contact.Birthdate}</p>

  </apex:pageBlock>                   

  <apex:detail relatedList="false" />

</apex:page>

This will output a date in the default format:

Thu Jul 01 09:10:23 GMT 2009

How do I get it (for example) into dd/mm/yyyy format, like this:

01/07/2009

(Hopefully, this is a fairly easy question, but to get the Salesforce community going on here I figure we need a few easy questions.) 

1 Answer

+2 votes
by (31.6k points)
edited by

To format a date in Visual Force, in dd/mm/yyyy format, try the following code:

Want to learn Salesforce from basics! Here's the right video for you on Salesforce provided by Intellipaat:

<apex:outputField value = "{!invitation.Account_group__r.Submission_Due_Date__c}"/>

Related questions

0 votes
1 answer
0 votes
1 answer
asked Aug 13, 2019 in Web Technology by Sammy (47.8k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...