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
Sure@DreamSure@Dream 

Display the date time in current user's timezone using apex:outputtext

Hi All,

I am displaying the createdDate field in visualforce page, using apex:outputtext.
<apex:outputText value="{!comment.CreatedDate}"/>

It is getting displayed in GMT timezone. Can I display it in current user's timezone, using apex:outputtext, without using any coding?

I cannot use outputField, it will give 'Not a valid binding' error

Thanks
Best Answer chosen by Sure@Dream
Sure@DreamSure@Dream
Hi,

Got is solved by giving a space in the value attribute(after starting quote):

<apex:outputText value=" {!comment.CreatedDate}"/>

All Answers

Sure@DreamSure@Dream
Hi,

Got is solved by giving a space in the value attribute(after starting quote):

<apex:outputText value=" {!comment.CreatedDate}"/>
This was selected as the best answer
Alesia DvorkinaAlesia Dvorkina
 Hi Sure@Dream, 
I am not a developer, but had to modify some Visualforce templates we have in our org. I was looking for a way to display date in a more "user friendly" way for our international users, and I came across this question/answer. Thank you for sharing!