Forum OpenACS Q&A: Response to to_char(now(), 'YYYY') and time zones

Collapse
Posted by Dan Wickstrom on
As an intermediate step, it's converting the time back to your local time zone. Try this instead:

openacs4=# select to_char(now(),'yyyy-mm-dd hh24:mi') at time zone 'utc';
        timezone
------------------------
 2001-04-12 11:48:00+00
(1 row)
 
openacs4=# select now() at time zone 'utc';
        timezone
------------------------
 2001-04-12 11:48:12+00
(1 row)
     

 openacs4=# select now();
          now
------------------------
 2001-04-12 07:50:26-04
(1 row)