I'm making an API callout that returns a date/time in the following format:

"Thu May 8 1:21 PM EDT"

as well as a timestamp in the following format (millis since unix epoch):


Since these are both fairly common date formats, I'm wondering if Salesforce provides functions to convert this data into values that can be stored in a datetime field, or if I'll have to write some code to convert it? Thanks for your help!

1 Answer 1


looks like I was searching for the wrong terms earlier: searching for unix epoch conversion revealed this link:

Convert Date to milliseconds and milliseconds to Date

As well as this:


EDIT: Oh, also, here's the documentation of the method that works directly with Unix millisecond timestamps


Constructs a Datetime and initializes it to represent the specified number of milliseconds since January 1, 1970, 00:00:00 GMT.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .