[SalesForce] Get only time from Datetime field I want to display only time value in apex:outputText.Is there any format to display only time.? Thanks in advance. Best Answer You need to use a apex:param for that: <apex:outputText value="The formatted time right now is: {0,date,HH:mm:ss}"> <apex:param value="{!NOW()}" /> </apex:outputText> Check this doc: apex:outputText Related Solutions[SalesForce] Timezone issue with Datetime Field [again ;-)] Use Apex to get User's TimeZone and offset time. e.g. <apex:page controller="TimeZoneController"> <apex:outputText value="{0,date,dd/MM/yyyy HH:mm:ss}"> <apex:param value="{!NOW()+offset}"/> </apex:outputText> </apex:page> public class TimeZoneController{ public Double offset{get{ TimeZone tz = UserInfo.getTimeZone(); //Milliseconds to Day return tz.getOffset(DateTime.now()) / (1000 * 3600 * 24.0); }} public TimeZoneController(){ } } [Reference] https://www.xgeek.net/salesforce/display-datetime-with-timezone-in-visualforce-page/ [SalesForce] how can I get only lookup icon functionality from inputField in visualforce You can remove the input field from the page by using CSS that is qualified by the element name (i.e. hide the input.hideField but not the a.hideField as the styleClass is applied to both the field and the lookup icon): <apex:page standardController="Contact"> <style> input.hideField { display: none; } </style> <apex:form> <apex:inputField value="{!Contact.AccountId}" styleClass="hideField"/> </apex:form> </apex:page> The input field remains in the DOM and is populated by the selection from the popup. Related TopicConvert String DateTime to User Locale Date Time in ApexVisualforce – Formatting New Time FieldApex Visualforce – Time Field from SOQL in Apex Not Populating Time in
Best Answer
You need to use a
apex:param
for that:Check this doc: apex:outputText