Re: to_char(now(), 'YYYY') and time zones

Поиск
Список
Период
Сортировка
От Alessio Bragadini
Тема Re: to_char(now(), 'YYYY') and time zones
Дата
Msg-id 3AD5B5BE.3D875E70@albourne.com
обсуждение исходный текст
Ответ на to_char(now(), 'YYYY') and time zones  (Simon Bæk Carstensen <simonbc@email.com>)
Список pgsql-general
Simon Bæk Carstensen wrote:

> 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).

The easiest way is to do

SET TimeZone TO 'CET';

[from now on all timestamps will be returned CET-base]

SELECT ...

You can then

SET TimeZone TO DEFAULT;

or wait for the end of the connection.

--
Alessio F. Bragadini        alessio@albourne.com
APL Financial Services        http://village.albourne.com
Nicosia, Cyprus             phone: +357-2-755750

"It is more complicated than you think"
        -- The Eighth Networking Truth from RFC 1925

В списке pgsql-general по дате отправления:

Предыдущее
От: Michael Ansley
Дата:
Сообщение: RE: to_char(now(), 'YYYY') and time zones
Следующее
От: Louis-David Mitterrand
Дата:
Сообщение: no OID field in OLD or NEW records inside trigger functions?