Bamaboy
Bamaboy

Reputation: 239

Need Postgres query result in given timezone

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

Upvotes: 0

Views: 92

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 246143

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;

Upvotes: 2

Related Questions