Re: timestamp (military) at time zone without the suffix

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: timestamp (military) at time zone without the suffix
Дата
Msg-id CAKFQuwYU2GgTnaOOQHxGSBfEZR1XxzN4PYKjNeovWuJTFYk2cA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: timestamp (military) at time zone without the suffix  (David Gauthier <davegauthierpg@gmail.com>)
Список pgsql-general
On Wednesday, July 11, 2018, David Gauthier <davegauthierpg@gmail.com> wrote:
I want to store the current UTC date/time in the DB.  Does PG unconditionally store something like UTC, then let the queries figure out how they want to look at it (with "at time zone" and "to_char()" etc...) ?  Or do I have to intentionally store the UTC value somehow?

If you use timestamptz the server interprets the stored value as being UTC.  If you use timestamp the server interprets the stored value using whatever the current Time Zone happens to be when the value is read (or it uses the at time zone value if specified).

David J.

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

Предыдущее
От: Ron
Дата:
Сообщение: Re: Open Source tool to deploy/promote PostgreSQL DDL
Следующее
От: "Igal @ Lucee.org"
Дата:
Сообщение: Re: How to tell which event was fired in Trigger function