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
Anu Raj.ax1269Anu Raj.ax1269 

Display data

Hi

I have created a custom object with 4 fields out of 1 is datetime field. I need to display the records from this object to a VF page. But the condition is that only the time from the datetime field should be displayed. I have done the code to get only time from the datetime field but I am not able to display the time on the Vf page using datatable or pageblocktable. 

 

Can anybody help me to solve this problem. 

 

Thanks

Anu

Best Answer chosen by Admin (Salesforce Developers) 
Gunners_23Gunners_23

Inside the pageblock table use the below approach to display the time

 

<apex:outputText value="{0,TIME,HH:mm:ss z}">
            <apex:param value="{!NOW()}"/>
</apex:outputText>

 

Replace the param value with the records DateTime field

All Answers

Gunners_23Gunners_23

Inside the pageblock table use the below approach to display the time

 

<apex:outputText value="{0,TIME,HH:mm:ss z}">
            <apex:param value="{!NOW()}"/>
</apex:outputText>

 

Replace the param value with the records DateTime field

This was selected as the best answer
Anu Raj.ax1269Anu Raj.ax1269

thanks Gunners_23.