Salesforce: Convert the date value in the logged in user local time format on Apex class

//Apex class Convert the time into local formate


DateTime createdDate = [SELECT CreateDate FROM Account LIMIT 1].CreatedDate;
Integer timeOffset = UserInfo.getTimezone().getOffset(createdDate);
createdDate = createdDate.addSeconds(timeOffset/1000); 

Comments

Popular posts from this blog

Transaction Security Policy In Salesforce

Salesforce Data Cloud

Add/Remove Content in the VF Page using JS