You need to sign in to do that
Don't have an account?
SidVicious
Json to Apex Helper class
Hi Developers,
I'm using a simple helper parser class to help deserialize my json string. I wanted to convert UsedDate from Long type to DateTime type, but can't figure out how to do it within this class.
Please help, thank you.
I'm using a simple helper parser class to help deserialize my json string. I wanted to convert UsedDate from Long type to DateTime type, but can't figure out how to do it within this class.
Please help, thank you.
public class Code { public String Code; public String Status; public Long UsedDate; // how to convert to DateTime public static List<Code> parse(String json) { return (List<Code>) System.JSON.deserialize(json, List<Code>.class); } }
Please refer the below link will help you to proceed further.
https://stackoverflow.com/questions/11773369/convert-from-long-to-date-format
Thanks,
Ankaiah