Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Cyber Security
  3. Question
Cyber Security

How to convert UTC to IST conversion in apex?

Asked by Chloe Burgess Jul 21, 2021 4.0K views 1 answer
Share

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?

Your answer

1 Answer

More Cyber Security discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Cyber Security Blogs

Guides, tips and career advice on Cyber Security from JanBask experts.