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
Simha YadavSimha Yadav 

i created standard account query list in that i added CreatedDate filed and displaying format like this 18/10/2014 10:13 AM but i dont want to display time here please give anybody solution

i created standard account query list in that i added CreatedDate filed and displaying format on vf like this 18/10/2014 10:13 AM but i dont want to display time here please give anybody solution.
Ajay K DubediAjay K Dubedi
Hi Simha,

Its  not very clear what are you asking about but feels like you don't want display the format like you mentioned so you can change the format of your date as:-
Datetime yourDate = Datetime.now();
String dateOutput = yourDate.format('dd/MM/yyyy');

Thanks.
Le NguyenLe Nguyen
Hi Simha,

You have to use outputtext to display Date or Datetime in given format:
 
<apex:outputText value="{0, date, dd-MM-yyyy}">
<apex:Param value="{!obj.CreatedDate}" />
</apex:OutputText>
This should display as example: 30-09-2015

Le
Simha YadavSimha Yadav
Hi Ajay K Dubedi,

i created account list in that list i added createddate field whic is standard field and displaying in vf as 18/10/2014 10:13 AM but here i dont want to display time...i need only like this 18/10/2014
Simha YadavSimha Yadav
Hi Ajay K Dubedi, i created account list in that list i added createddate field whic is standard field and displaying in vf as 18/10/2014 10:13 AM but here i dont want to display time...i need only like this 18/10/2014.
Ajay K DubediAjay K Dubedi
Hello Simha,
As I understand you want  to convert dateTime to date  field  go through this code:
DateTime dt = Createddate;
Date d = dt.date();
for more detail you can visit this link 
https://developer.salesforce.com/forums/?id=906F00000008wFbIAI

Thanks 
 
Simha YadavSimha Yadav
how to add to list and is it display for every record in vf?
Ajay K DubediAjay K Dubedi
Hi Simha,

If you want to avoid date manipulation with Apex, you could also create a custom date formula field and query off that field. Your formula would look like this:
DATEVALUE(CreatedDate)
Then just query off your custom field.

Thanks.