We have a requirement in which we copy Event.StartDateTime in another field called Activity.Start_Date_Time_Text__c. The calculation of DateTime (UTC at rest) Text happens in before insert and update triggers. I do the conversion using following code snippet.
anEvent.Start_Date_Time_Text__c = dtEventStartDateTime.format('MM/dd/yyyy hh:mm:ss a', 'America/Chicago');
"America/Chicago" here is for testing purposes, it could be any timezone in IANA format. My requirement is to put even the timezone in the text field.
Right now, the text field looks like "11/13/2018 12:30:00 PM" instead it should look like "11/13/2018 12:30:00 PM CST" or "11/13/2018 12:30:00 PM CDT" or "11/13/2018 12:30:00 PM CT"
In the code I only have timezone in the IANA format (i.e. "America/Chicago or "America/Los_Angeles". One of the solutions is for me to maintain a mapping but I was wondering if there is a out of the box solution by which I can do this programmatically instead maintaining a map.