0

I have a table with creation timestamps as decimals and am trying to convert to date data type. When I go to cast as date I get the following error message: "ERROR: cannot cast type double precision to date". [column example]

cast(creation_timestamp as date)
tidy2021
  • 39
  • 8
  • 3
    1) Do not post images for textual data. Copy and paste as text 2) Store timestamps as `timestamptz` not `decimal`. 3) Try: `to_timestamp((creation_timestamp *)/1000)::date` – Adrian Klaver May 12 '22 at 20:46
  • That should have been: `to_timestamp((creation_timestamp * 1000000000000)/1000)::date`. – Adrian Klaver May 12 '22 at 21:38
  • https://blog.sql-workbench.eu/post/epoch-mania/ –  May 13 '22 at 05:32

0 Answers0