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
Nandhini S 3Nandhini S 3 

Date is displayed in user's local timezone

Hi Guys,

I have a controller class which displays a date. The date is displaying in user's local time zone. But it should display in company's time zone. How can i format it?
Vishwajeet kumarVishwajeet kumar
Hello,
You can try to use TimeZone to format date time in comapny time zone, by default date time are stored in GMT in salesforce database. Checkout this article (https://medium.com/salesforce-zolo/what-every-salesforce-developer-should-know-about-dates-and-times-in-apex-d49bc0a116d4) for more details.

Thanks