You need to sign in to do that
Don't have an account?
Meeta Khullar 5
Date field output format issue
I have a 2 VF page, one is used to create the output based on the input that is provided by the user and the other one is to create the csv file. I have date field as the output. The problem that I'm having is the csv output looks something like this for the date field "Thu Jan 01 00:00:00 GMT 2015". I want it in the mm/dd/yyyy format. How can I do this, here is the code for the VF for creating the csv file
apex:page controller="RMSControllerTest" contentType="application/vnd.ms-excel#ConsignmentSearchData.csv" cache="true" >Invoice Number,Invoice Line Name,Product Name, Product Line, Start Date, End Date, Recognized Revenue, Deferred Revenue, Total Amount, QAD Domian, Created Date
<apex:repeat value="{!invoiceLines}" var="item">
{!item.invoiceLine.invoice__r.name},{!item.invoiceLine.name},{!item.invoiceLine.Start_Date__c},{!item.invoiceLine.End_Date__c},{!item.recognizedRevenue},{!item.deferredRevenue},{!item.totalAmount},{!item.invoiceLine.CreatedDate}
</apex:repeat>
</apex:page>
apex:page controller="RMSControllerTest" contentType="application/vnd.ms-excel#ConsignmentSearchData.csv" cache="true" >Invoice Number,Invoice Line Name,Product Name, Product Line, Start Date, End Date, Recognized Revenue, Deferred Revenue, Total Amount, QAD Domian, Created Date
<apex:repeat value="{!invoiceLines}" var="item">
{!item.invoiceLine.invoice__r.name},{!item.invoiceLine.name},{!item.invoiceLine.Start_Date__c},{!item.invoiceLine.End_Date__c},{!item.recognizedRevenue},{!item.deferredRevenue},{!item.totalAmount},{!item.invoiceLine.CreatedDate}
</apex:repeat>
</apex:page>
use below Code,
Hope this will help you,
Mark Best ANSWER if its works for you.
Thanks
karthik