I am getting date into JSON as below :
It seems that date has been returned in milliseconds format.
Can anyone please suggest the way to convert it into normal date format and vice versa ?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
This is known as a "Unix Timestamp" (number of milliseconds since January 1st, 1970, 00:00:00 GMT). In Apex Code, you can use
DateTime.newInstance(unixTimestamp) to return a
new Date(unitTimestamp) to get the same result. To convert back, in Apex Code, use