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
igorcguedesigorcguedes 

How to Format Date - Visualforce Page?

Hi!
I have a page using tables.

<tr>
<td class="table td">Data</td>
<td class="table td_right">{!formularioVisita.Data__c}</td>
</tr>

How i can format the data?

I tried some things using the apex but not sucess at all.

 

Best Answer chosen by igorcguedes
Kamil_GKamil_G
Try this code below:
<tr>
	<td class="table td">Data</td>
	<td class="table td_right">
		<apex:outputText value="{0,date,dd/MM/yyyy HH:mm:ss}">
			<apex:param value="{!formularioVisita.Data__c}"/>
		</apex:outputText>	
	</td>
</tr>

 

All Answers

Kamil_GKamil_G
Try this code below:
<tr>
	<td class="table td">Data</td>
	<td class="table td_right">
		<apex:outputText value="{0,date,dd/MM/yyyy HH:mm:ss}">
			<apex:param value="{!formularioVisita.Data__c}"/>
		</apex:outputText>	
	</td>
</tr>

 
This was selected as the best answer
Syed Insha Jawaid 2Syed Insha Jawaid 2
Hi
Please try this : 

<apex:outputText value="{0,date,MM/dd/yy}">
<apex:param value="{!formularioVisita.Data__c}" />
 </apex:outputText>
igorcguedesigorcguedes

Thanks!

This resolves the problem exactly how i need, thanks.