About this question
I am getting the time as string like "client_modified": "2020-02-04T11:27:34Z" How can I convert this to local time zone,
Update:
I am getting this time from api response I need to display it in lightning:formatteddatetime, Sort those records based on date time so am doing this conversion in controller side
code:
string s = string.valueof(a2.get('server_modified')); DateTime LDate = null; if(s != null && s != ''){ s = s.replace('T', ' '); s = s.replace('Z', ''); LDate = DateTime.valueof(s); }How to convert utc to ist in apex?