Re: Timestamp with vs without time zone.

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: Timestamp with vs without time zone.
Дата
Msg-id YUornXkmeFOeiaud@hjp.at
обсуждение исходный текст
Ответ на Re: Timestamp with vs without time zone.  (FWS Neil <neil@fairwindsoft.com>)
Список pgsql-general
[Can y'all please trim your quotes? Having to scroll down 80+ lines to
get to the content is cumbersome]

On 2021-09-21 13:17:39 -0500, FWS Neil wrote:
> A timestamp cannot have a time zone and be a valid timestamp.
>
> Let me explain.
>
> A timestamp is a single time that exists in the world.

Correct.

> For example March 1, 2021, 4:15 am is a timestamp.

This is NOT a timestamp, because it is not a single time that exists in
the world. It is about 30 different times that exist in the world.

You can turn it into a timestamp by adding timezone information:

March 1 2021, 4:15 am, America/Chicago

Now it's a single time, equivalent to 2021-03-01T10:15:00Z.

However, if you don't have to store the timezone if you have some other
way to unambiguously specify the time, e.g. by always using UTC or by
storing seconds since an epoch.

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Вложения

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

Предыдущее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: Re: Timestamp with vs without time zone.
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Timestamp with vs without time zone.