DATETIME_PARSE({UNIXTIME},'x', 'EST')


#1

I keep getting ERROR code

My formula is DATETIME_PARSE({UNIXTIME},‘x’, ‘EST’)

How can I convert a 13 digit unix time stamp into a date like this: 2/7/2019 8:09pm

I have this:1549584840000
I need this: 2/7/2019 8:09pm


#2

I think your problem is the locale modifier you’re using; ‘EST’ doesn’t seem to be valid. (To be honest, I didn’t know DATETIME_PARSE() even supported a third variable; it’s optional.) AFAIK, the ‘locale’ option doesn’t do anything with the timezone, as such — that is, I don’t think it will take a datetime value (presumably at some standard timezone and shift it appropriately for the locale; it controls such things as spelling of the day of the week and culturally appropriate formats.

A list of acceptable locale modifiers can be found here — or, unless you have a specific need for it, just leave it off.

To force a timezone, you need to use SET_TIMEZONE(), typically in conjunction with DATETIME_FORMAT().