You need to sign in to do that
Don't have an account?

Convert String(2016-02-04T22:21:32.169Z) to DateTime
HI
I have date in 2016-02-04T22:21:32.169Z format.How to convert it to Apex DateTime?
Ed
I have date in 2016-02-04T22:21:32.169Z format.How to convert it to Apex DateTime?
Ed
https://developer.salesforce.com/forums/?id=906F000000090P7IAI
All Answers
refer valueOf in this link https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_date.htm
Best,
Ritk
Ed
You can try this - Pls, Let me know If it helps you.
Thnaks,
Sumit Kumar Singh
You can write a method to convert Sting into DateTime, and use that method where ever you want.
Thanks,
SumitKumar Singh
https://developer.salesforce.com/forums/?id=906F000000090P7IAI
(DateTime)json.deserialize('"YYYY-mm-ddThh:mm:ss.SSSZ"', datetime.class)
EX:(DateTime)json.deserialize('"2020-07-10T02:48:37.327Z"', datetime.class