Activity Forums Salesforce® Discussions How can I show a date time field on visualforce page based on users current time zone?

  • Abhinav

    Member
    April 25, 2016 at 9:08 am

    Hello rachit you can use the outputText tag to show the time on the VF page. Example below :-

    <apex:outputText value="The formatted time right now is:
    {0,date,yyyy.MM.dd G 'at' HH:mm:ss z}">
    <apex:param value="{!proPrices.fromDate__c}" />
    </apex:outputText>

     

  • vishakha

    Member
    October 14, 2022 at 11:17 am

    To show a date time field on visualforce page based on user's current time zone the code can be written as <apex:outputText value=”{! NOW()}” /> – it will show GMT time. <apex:outputText value=” {! NOW()}” /> – it will show time in your local time zone (note that blank space has been added before the left brace)

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos