0

When I ask PostgreSQL for a timestamp with time zone at a certain time zone, it does not print the time zone:

SELECT now()::timestamp WITH TIME ZONE AT TIME ZONE 'CST';

          timezone          
----------------------------
 2023-11-08 06:00:28.983353
(1 row)

Whereas:

SELECT now()::timestamp WITH TIME ZONE;

              now              
-------------------------------
 2023-11-08 12:01:00.704341+00
(1 row)

Does print the time zone (+00)?

Why?

I was naturally expecting a time zone indication with the first query. Or, when asked without:

SELECT now()::timestamp WITHOUT TIME ZONE AT TIME ZONE 'CST';

           timezone            
-------------------------------
 2023-11-08 18:08:25.911371+00
(1 row)

it does print it.

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.