Another Salesforce blog!!!

Salesforce, Apex

Converting GMT into Locale Users Time Zone


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);

Leave a Reply

Your email address will not be published.

*