0

I save all columns in UST. But I need to get all results in a particular timezone. I am using postgres.

I am looking for something like following

SELECT reported_time IN timezone 'Asia/Kolkata' FROM allusers;

I need result in 'Asia/Kolkata' timezone for exporting to a csv

1 Answer 1

2

Provided that reported_time is of type timestamp with time zone as it should, the answer is

SELECT reported_time AT TIME ZONE 'Asia/Kolkata' FROM allusers;
Sign up to request clarification or add additional context in comments.

2 Comments

I need the result contain modified timezone info also. Currently, it returns without timezone info. Is there any way to achieve this
Are you looking for SELECT utc_offset FROM pg_catalog.pg_timezone_names WHERE name = 'Asia/Kolkata'?

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.