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
balaji aluri 16balaji aluri 16 

How to display a datetime field as per user timezone

Hi Team,

We have one requirement like,   I have created one custon DateTime field(Field Name: TestDateTime__c) on User object. Now i need to display that datetime filed in visulaforce page as per the user's Timezone. And when i change the user timezone on user record, the datetime field on VF page should be displayed according to the timezone update. Can anyone please help me out with apex code for this requirement.

Quick response would be appreciated.

Thanks,
Balaji A
NagendraNagendra (Salesforce Developers) 
Hi Balaji,

Sorry for this issue you are encountering.

May I suggest you please check with below link which might help you further. Please let us know if this helps.

Regards,
Nagendra
Fazurulla GagangapalliFazurulla Gagangapalli
Hello Balaji,

Use :  
{!$User.TestDateTime__C} in your VF page.

Please let us know if this helps.

Regards,
Faz