I have a timestamp in my data base with values like this:
1639267200000 (current date, today)
If I do a simple query like:
select date from data
it is shown like a string as:
2021-12-11 00:00:00 +0000 UTC
With the date conversor
it does not work (no result), so I use the suggested conversor to convert a “date” column to a parsable timestamp
WITH converted AS (
SELECT date || ‘’ AS datetime FROM data
)
SELECT datetime FROM converted ORDER BY datetime ASC
and then I get the current timestamp just like I see in the database:
If I transfor this number to current date in https://www.unixtimestamp.com/, it is ok, but the timee formatted columns conversor does not work.
Other solution I read was to try with this query
SELECT
REPLACE(date, ’ ',‘T’) || ‘’ AS time
FROM data
ORDER BY time ASC
The result is the same unix timestamp value (1639180800000) and then the conversor works, but the date is totally wrong:
No idea why or what else to do.