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)
3
  • 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 Commented May 12, 2022 at 20:46
  • That should have been: to_timestamp((creation_timestamp * 1000000000000)/1000)::date. Commented May 12, 2022 at 21:38
  • blog.sql-workbench.eu/post/epoch-mania Commented May 13, 2022 at 5:32

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.