I'm trying to pull the current year with the following query:
select to_char(now(), 'YYYY');
This is fine. Now, I would like to select this date in different time
zones.
Normally I just do:
select now() at time zone 'utc';
I guess I need a combination of the 2 queries above - one that asks for
ONLY the year in a certain time zone (fx UTC or CET).
I guess I should do some sort of subselect like:
select to_char(utc, 'YYYYY') from (select now() as utc at time zone
'utc')
But that jsut gives me an error.
Does anyone know how to do this?
-- Simon Carstensen