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
sfdc@isha.ax1814sfdc@isha.ax1814 

how to convert time from GMT time zone to local time zone?

Hi,

 

how to convert time from gmt to local time zone?for ex:lastmodifieddate displays in GMT time zone if i want to display in local time zone how i will display?can anybody help me?

 

 

 

Thanks,

Isha

 

 

 

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
souvik9086souvik9086

What do you mean by local time zone?

If your account time zone is set as your local time zone then the last modified date will be displayed as local time zone.

You will get that in Personal Information.

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

 

All Answers

souvik9086souvik9086

What do you mean by local time zone?

If your account time zone is set as your local time zone then the last modified date will be displayed as local time zone.

You will get that in Personal Information.

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

 

This was selected as the best answer
vikas88vikas88

Hi,

 

Try this:

 

String timeZone = UserInfo.getTimeZone().getID();
Datetime dateGMT=System.now();// here you can user your dates e.g. createddate
Datetime d1=Datetime.valueOf(dateGMT);
string s1=d1.format();
System.debug('@@@@@@@@@@@'+s1);

 

if this is your solution please mark it as solved.

Nathan LewisNathan Lewis
On my calendar it is showing that the time is set for PST and need to move to EST so that way when I add an event I will get the reminders