From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: Re: Timestamp with vs without time zone.
Date: Tue, 21 Sep 2021 10:44:20 +0200
Message-ID: <YUmbZHqaq+NGLC1B@hjp.at> (raw)
In-Reply-To: <trinity-8442e59f-d55e-42a5-8699-47be32a9b347-1632209999042@3c-app-gmx-bap35>
References: <CAGuHJrPKdrXGAFkzE4tXd3b5uKe47WCRdV3LNrYi_HBjYYa+OA@mail.gmail.com>
<ae03895fc4ba57bce2195919aad40899c7d484b7.camel@cybertec.at>
<CAGuHJrNeP8H-J9LD-pwO5gaNhSSKSgfn=oBKrH5-ifyoy+WgrA@mail.gmail.com>
<trinity-8442e59f-d55e-42a5-8699-47be32a9b347-1632209999042@3c-app-gmx-bap35>
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!"
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: hjp-pgsql@hjp.at
Subject: Re: Timestamp with vs without time zone.
In-Reply-To: <YUmbZHqaq+NGLC1B@hjp.at>
References: <CAGuHJrPKdrXGAFkzE4tXd3b5uKe47WCRdV3LNrYi_HBjYYa+OA@mail.gmail.com> <ae03895fc4ba57bce2195919aad40899c7d484b7.camel@cybertec.at> <CAGuHJrNeP8H-J9LD-pwO5gaNhSSKSgfn=oBKrH5-ifyoy+WgrA@mail.gmail.com> <trinity-8442e59f-d55e-42a5-8699-47be32a9b347-1632209999042@3c-app-gmx-bap35> <YUmbZHqaq+NGLC1B@hjp.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox