You need to sign in to do that
Don't have an account?
newbee developer
SOQL query to display Modified Date without time
Hello All, Below is my query.
This query doesnt order by Last Modified Date DESC.
Also, I want to display LastModifiedDate in Date Only format.
Right now, it displays value as below:
I want to display as 11/18/2017
MyItems = [SELECT Id,Title,LastModifiedById,LastModifiedDate
FROM Knowledge__Kav WHERE Id IN :ProcessInstanceIds ORDER By LastModifiedDate DESC];
ProcessInstanceIds is a set of IDs from another object. FROM Knowledge__Kav WHERE Id IN :ProcessInstanceIds ORDER By LastModifiedDate DESC];
This query doesnt order by Last Modified Date DESC.
Also, I want to display LastModifiedDate in Date Only format.
Right now, it displays value as below:
11/18/2017 1:17 AM
I want to display as 11/18/2017
<apex:pageBlockTable value="{! MyItems }" var="r">
<apex:column headerValue="Title">
<a target="_blank" href= "/{!r.Id}" >{!r.title}</a>
</apex:column>
<apex:column headerValue="Last Modified Date"><apex:outputfield value="{!r.LastModifiedDate}"/></apex:column>
<apex:column value="{!r.CreatedById }" headerValue="CreatedBy"/>
</apex:pageBlockTable>
<apex:column headerValue="Title">
<a target="_blank" href= "/{!r.Id}" >{!r.title}</a>
</apex:column>
<apex:column headerValue="Last Modified Date"><apex:outputfield value="{!r.LastModifiedDate}"/></apex:column>
<apex:column value="{!r.CreatedById }" headerValue="CreatedBy"/>
</apex:pageBlockTable>
Firstly create a formula field with return type date and then retrive the date from LastModifiedDate using that formula field and then use the newly created custom field to retrive the date.
Thanks
Geetham.
You can try this:
<apex:outputText value="{0, date, MM/dd/yyyy}"> <apex:param value="{!r.LastModifiedDate}" />
0 is replaced by the first parameter (counting 0,1,2, ...) and formated according the format used in java (1.5)