Convert UNIX date time to datetime

Hi,

I am trying to create a date query variable from a table.

The data column in the table is stored as the DateTime type, but when I run the query in the variable page it returns the Unix time stamp format.
The same query in the psql returns the result as expected

So I tried the following queries and none of them is working.

select TO_TIMESTAMP(datetime) from model_view
select timezone('AEDT', to_timestamp(datetime)) from model_view
select extract(epoch from datetime) from model_view
select to_timestamp(extract(epoch from datetime)) from model_view

Also, if I use the grafana macros as follows it returns a single value

select $__timeFrom(datetime) from model_view

2022-06-23_18-22

any recommendation?

THANK YOU!!