Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mSbOC-00018F-FT for pgsql-general@arkaria.postgresql.org; Tue, 21 Sep 2021 08:44:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mSbOA-0003QF-TN for pgsql-general@arkaria.postgresql.org; Tue, 21 Sep 2021 08:44:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mSbOA-0003Q3-KQ for pgsql-general@lists.postgresql.org; Tue, 21 Sep 2021 08:44:30 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mSbO2-0002kZ-Ub for pgsql-general@lists.postgresql.org; Tue, 21 Sep 2021 08:44:29 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 470C4565E; Tue, 21 Sep 2021 10:44:20 +0200 (CEST) Date: Tue, 21 Sep 2021 10:44:20 +0200 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Re: Timestamp with vs without time zone. Message-ID: Mail-Followup-To: pgsql-general@lists.postgresql.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tZMAXQNyQ/nwBqpl" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --tZMAXQNyQ/nwBqpl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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.=20 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=20 '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 --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --tZMAXQNyQ/nwBqpl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmFJm10ACgkQ8g5IURL+ KF2QVA//eGFcQn6gbCOClbqxkpiFDI6P2edDb4h2Uk/SQlx99U0l06CQMxvx6f2Z +6P9iujCX5xuBMx8EFMIHcjS7zcrOqKYeNPlXTA/2i3pO9COmwytoOBNsokbWPG2 qmqAnE5HIeshvTUwVlicPIFHDUUZRu9Ob1DAXApOGH8Gvy1YzS8dhDM3sm6MUMef dwNJ13wGi/3WhXnZjzUu6qjEW63TOVGg9Za+1mViIoRyqaWrLUn2sV1+zUurwf+q tjcKRComLgk+FEgiuh3FPnF3W3Z7KF3zp3LiGzfwCe3cCnw2gLn/hPhngai6TcLH tPtPrxvzC03nQh5HJpzHEFIY4h3YARuW0PI38tzpve5TIBNsOHh6IKVqimjMxABr B5G1WT4v274MhXpyHEIT6Lc4J1/eEciAuEKqm3L7Mk2BvmrhSZlU3w0+s0N/FlMN 212DxAfn3nic5eX+jPw3jiKY9Mt6ztKI7o4Y5jgRj7JyovMeWIWXeE/R2J2UVhLH XhDK/IQ+8tDa84z/qmsMv5DJMkp9WJxRKkv/9DpVnlLfPSrQmseKg5HGpsFboILJ G8C/RCsUhue4etKSVAvgwWyV9Lg8P1KPjJQrsSnYRapG/LRzXyUkjhVrffe7NEXu XMY/wmip6v/cHb6Pv39JN4AicDPmcByvGz6h0cvXT0WIpMtrLlU= =QAjQ -----END PGP SIGNATURE----- --tZMAXQNyQ/nwBqpl--