1

I am trying to format a date in VisualForce so that it looks like this:

Tuesday 02/22/11

I found this reference on stackoverflow:

How to format a date in VisualForce?

But I cannot determine what to put in the format string.

I tried using an e as referenced here:

http://download.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html

But when I do that:

<apex:outputText value="{0,date,MM'/'e'/'yy}">
        <apex:param value="{!od.PriceBookEntry.Product2.Start__c}" /> 
</apex:outputText>

I get a save error of:

Save error: The Date format pattern for is invalid


<apex:outputText value="{0,date,EEE MM'/'yy}">
    <apex:param value="{!od.PriceBookEntry.Product2.Start__c}" /> 
</apex:outputText>
Community
  • 1
  • 1
user632739
  • 11
  • 1
  • 2

1 Answers1

6
<apex:outputText value="{0,date,EEEE MM'/'dd'/'yyyy}">
    <apex:param value="{!od.PriceBookEntry.Product2.Start__c}" /> 
</apex:outputText>

Outputs:

Monday 10/02/1944

Ryan Guest
  • 6,080
  • 2
  • 33
  • 39
  • 2
    How do you get this formating to take the users timezone into account and display that time in their local timezone instead of GMT? – Keith Mancuso May 20 '13 at 22:18