Hi,
I can’t seem to figure out what’s wrong with my formula. I’m trying to convert a UNIX timestamp which is in a Single Line Text field, into a corresponding date field.
My UNIX is in a field called _eventTimestamp and value is 1663598125000 stored in a Single Line Text field.
My date field has the formula
DATEADD('1/1/1970',_eventTimestamp,'seconds')
and the formula results to 4/30/54687 2:16am
I can’t seem to figure out why that is. I checked the UNIX timestamp online and it shows me the correct converted date
It’s probably a blindspot but I can’t seem to figure out why I’m getting a weird value for the date in Airtable.
Any help would be much appreciated.
Thank you.
Update 1:
I even tried converting the UNIX timestamp to a numeric value thinking the DATEADD needs to add a number and so I tried the formula
DATEADD('1/1/1970',VALUE(_eventTimestamp),'seconds')
…but I still get this odd date 4/30/54687 2:16am
Update 2:
SOLVED
For anyone interested in the solution, I finally figured this out. It appears that my UNIX timestamp had three extra digits indicating the milliseconds since 1/1/1970 and I was using the DATEADD to add that number as seconds and so was getting 1000 times as much. I simply divided the UNIX timestamp by 1000 and then used the same formula which worked fine.