Help

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

1699 0
cancel
Showing results for 
Search instead for 
Did you mean: 
BobBannanas
6 - Interface Innovator
6 - Interface Innovator

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

3 Replies 3

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().

I’m having the same issue here.
I’ve tried everything suggested here as well-

Just throws errors. 13 digit unix timecode. Just need a formula to convert to D/M/YYYY in (what I’m assuming is automatically determined as) PST timezone

Spencer_Allen
6 - Interface Innovator
6 - Interface Innovator

Nevermind :slightly_smiling_face: I think the problem I had was that I was trying to parse a string field rather than an integer. Once I converted the source column, it works great!