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
SFDC9999SFDC9999 

Issue with date format on Visual force page (Taking locale into consideration)

Hi,

I am trying to display a date field and it always displays in US format and it is causing an issue . Any insight please on this 
 
<apex:column styleClass="product_info_col">
                                   
                                        <span><a href="javascript:void(0)" 
                                            onclick="openProductDetailModal('{!$Site.Prefix}/apex/CCMTY_OrderProductDetailModal?id={!orderItem.PricebookEntry.Product2Id}&pricebookEntryId={!orderItem.PricebookEntryId}');">
                                            {!orderItem.PricebookEntry.Product2.Name}
                                            </a>
                                        </span>

                                     <span>{!$Label.CCMTY_OrderEntry_HeaderLabel_UnitPrice}: {!orderItem.unitPrice}</span>       

                                   <span>{!$Label.CCMTY_OrderEntry_HeaderLabel_EstimatedShipDate}:&nbsp;
                                   <apex:outputText value="{0,date,Long}">
                                   <apex:param value="{!orderItem.Estimated_Ship_Date__c}" /> 
                                   </apex:outputText></span>
                                   
                                   <span>{!$Label.CCMTY_OrderEntry_HeaderLabel_EstimatedDeliveryDate}:&nbsp;
                                   <apex:outputText value="{0,date,Long}">
                                   <apex:param value="{!orderItem.Order_Line_Estimated_Delivery_Date__c}" /> 
                                   </apex:outputText></span>
                                                            
                        <!--     <Apex:outputlabel value="{!$Label.CCMTY_OrderEntry_HeaderLabel_EstimatedDeliveryDate}" style="white-space:pre;"  escape="true"/> 
                                    <apex:outputField label="{!$Label.CCMTY_OrderEntry_HeaderLabel_EstimatedDeliveryDate}" value="{!orderItem.Order_Line_Estimated_Delivery_Date__c}"  /> -->
                                 </apex:column>

Thanks 
G
SFDC9999SFDC9999
{0, date, Short } Does not even work
mritzimritzi
Try this:
<apex:outputText value="{0, DATE, dd MMM',' yyyy}">
    <apex:param value="{!object__c.dateField__c}"/>
</apex:outputText>

<!-- you can play around with the format in outoutText tag -->

<apex:outputText value="{0, DATE, dd'/'MMM'/ yyyy}">
    <apex:param value="{!object__c.dateField__c}"/>
</apex:outputText>

<apex:outputText value="{0, DATE, MMM'-'dd'-'yyyy}">
    <apex:param value="{!object__c.dateField__c}"/>
</apex:outputText>


Hit LIKE if this helps, Mark it as Best Answer if it solved your problem