Your approach is perfect to convert values according to specific Timezone as:
System.debug(' Current Time is '+ DateTime.now() );
System.debug(' Converted Time to PST is ' +
DateTime.now().format('MM/dd/yyyy HH:mm:ss',
'America/Los_Angeles')
);
However you can convertTimezone SOQL function in your query. It converts DateTime field to the user’s time zone.:
Case c = [SELECT Id, convertTimezone(SlaStartDate) FROM Case WHERE Id='caseId'];
Best Answer