I use the PostgreSQL extract
function to pull out month, quarter, year like this:
select extract (month from adate) from atable
adate
is a timestamp with time zone
.
The problem I have is that I find this function completely ambivalent of timezone and I am dealing with a database with data that varies by timezone. So in some cases I need the result in respect to pacific timezone in other cases I need the result in respect to EST or CST, etc.
Is there a way to get the month/quarter/year of the date in respect to a specific timezone?