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 1nACZD-0002Gc-GQ for pgsql-jdbc@arkaria.postgresql.org; Wed, 19 Jan 2022 15:08:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nACZC-0008Ab-32 for pgsql-jdbc@arkaria.postgresql.org; Wed, 19 Jan 2022 15:08:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nACZB-00089g-Rx for pgsql-jdbc@lists.postgresql.org; Wed, 19 Jan 2022 15:08:05 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nACZ9-0005zV-Iy for pgsql-jdbc@lists.postgresql.org; Wed, 19 Jan 2022 15:08:04 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 20JF7xge505671; Wed, 19 Jan 2022 10:07:59 -0500 From: Tom Lane To: "David G. Johnston" cc: Thomas Kellerer , "pgsql-jdbc@lists.postgresql.org" Subject: Re: Startup parameters timezone conversion In-reply-to: References: <22f1218b-d700-141c-e9ef-08f7cb066411@gmx.net> Comments: In-reply-to "David G. Johnston" message dated "Wed, 19 Jan 2022 07:53:17 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <505669.1642604879.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 19 Jan 2022 10:07:59 -0500 Message-ID: <505670.1642604879@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > Indeed I presume it is. I wonder whether a carefully chosen timezone > specification on the server would cause this to break since the server c= an > be made to report the offset using either convention and so at least for > some timezone specifications the flipping of the sign would not be requi= red=E2=80=A6 AFAIK, "reporting the offset" is always done with the ISO convention. It's only when trying to interpret a time zone specification that we consider the POSIX convention (and that's mostly because the underlying tzdb code does so). This does lead to fun stuff like postgres=3D# set timezone =3D 'GMT+2'; -- read as POSIX zone spec SET postgres=3D# select now(); now = ------------------------------- 2022-01-19 13:03:36.000152-02 -- report as ISO (1 row) postgres=3D# set timezone =3D '+2'; -- read as numeric ISO offset SET postgres=3D# select now(); now = ------------------------------- 2022-01-19 17:03:41.722767+02 -- report as ISO (1 row) IMO, all these cases are best-avoided legacy conventions. In practice you should set the timezone using the tzdb zone name for where you live, e.g. America/New_York. regards, tom lane