Re: Getting the name of the timezone, adjusted for daylight saving

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Getting the name of the timezone, adjusted for daylight saving
Дата
Msg-id 24078.1296071734@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Getting the name of the timezone, adjusted for daylight saving  (Mark Morgan Lloyd <markMLl.pgsql-general@telemetry.co.uk>)
Список pgsql-general
Mark Morgan Lloyd <markMLl.pgsql-general@telemetry.co.uk> writes:
> Thanks Tom. Timestamps are going into the database which are implicitly
> UTC, and I was looking for a way to convert them when displayed to the
> local timezone (the client gets this from a configuration file and puts
> it in the query) and also to present the timezone name.

Consider setting timezone to what the client asks for.

> So I think that what you're saying is that the result from to_char()
> will always be UTC, possibly corrected for daylight saving (i.e. GMT or
> BST respectively).

No, the result is computed on the assumption that we're in the zone
specified by the timezone setting.  This might be hard to wrap your head
around if you only test in GMT or GMT0BST zones --- try something where
the offset is never zero to get a clearer picture of what's going on.

            regards, tom lane

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

Предыдущее
От: Steve Crawford
Дата:
Сообщение: Re: Getting the name of the timezone, adjusted for daylight saving
Следующее
От: Alban Hertroys
Дата:
Сообщение: Re: check on foreign table?