Show Unix Timestamp as Datetime

I have an import with timestamp in Unix format. How do I get it to show as DateTime?

Good question. Grist actually stores Date and DateTimes internally as a Unix timestamp. There are a couple of ways to do this, depending on your needs:

  1. Let’s say you have a numeric column A with a numeric value like 1666828800. Add another column, say, B, with the simple formula $A, and set the type of B to DateTime (see changing column type). B will then show 2022-10-26 8:00pm (or a variation depending on the time zone and the format).

  2. If instead you’d like to change the column A itself to the type DateTime, then you can change the type of the column to DateTime, but you’ll need an extra step:

    Click “Revise”, then edit the formula that shows up just above it, and replace its entire contents with just $A. You can click “Preview” to check if it looks right, then “Apply” to finish conversion.

I can’t get it to work with solution 1. I set the column next to the “ts”-column as DateTime and added the formula =$ts which seem to work, but the column doesn’t show as DateTime it just returns the same value but with red alert markings on it.

Timestamps looks like this “1524988175.000027”. Does the decimal values cause issues?