Re: Re: Timestamp with vs without time zone.

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: Re: Timestamp with vs without time zone.
Дата
Msg-id YUmbZHqaq+NGLC1B@hjp.at
обсуждение исходный текст
Ответ на Aw: Re: Timestamp with vs without time zone.  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Ответы Re: Re: Timestamp with vs without time zone.  (Tim Uckun <timuckun@gmail.com>)
Список pgsql-general
On 2021-09-21 09:39:59 +0200, Karsten Hilbert wrote:
> > It seems like it would be so much more useful if the timestamp with
> > time zone type actually stored the time zone in the record.
>
> Which one ?

To expand on that question a bit:

There are several formats to specify a time zone: By offset, by name
(several nomenclatures), etc.

For example, Karsten's mail had a timestamp of "2021-09-21 09:39:59
+0200". Thst's enough information to convert it to UTC, but not enough
for date arithmetic. For example what is
    '2021-09-21 09:39:59 +0200' + '2 months'::interval?

Should the result be '2021-11-21 09:39:59 +0200' or '2021-11-21 09:39:59
+0100'? I'm guessing that Karsten is in Germany, so it's probably the
latter. But to compute that you need to know that the timezone is
Europe/Berlin (or at least CET). Even that is not enough for dates in
the more distant future. The EU has decided to abolish DST (that should
have happened in 2020, but of course there was that little problem that
got in the way), but we don't know when that will happen and which
timezone Germany will choose. So for a date in e.g. 2025 we simply don't
know what the timezone offset will be.

        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 по дате отправления:

Предыдущее
От: Karsten Hilbert
Дата:
Сообщение: Aw: Re: Re: Timestamp with vs without time zone.
Следующее
От: Tim Uckun
Дата:
Сообщение: Re: Re: Re: Timestamp with vs without time zone.