public inbox for [email protected]  
help / color / mirror / Atom feed
From: David G. Johnston <[email protected]>
To: H Witt <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: why at time zone tz_offset not equal tz_name? tz_name has same offset in pg_timezone_names
Date: Mon, 28 Apr 2025 20:07:54 -0700
Message-ID: <CAKFQuwZgkaqZK5QNPceV090A4FW-PU384jbq_Tm6nt34-qeXYw@mail.gmail.com> (raw)
In-Reply-To: <OSBPR01MB29975FFDA1D860B20A8AC85C9B802@OSBPR01MB2997.jpnprd01.prod.outlook.com>
References: <OSBPR01MB299716C895A69A6DFCF3357C9B812@OSBPR01MB2997.jpnprd01.prod.outlook.com>
	<OSBPR01MB29975FFDA1D860B20A8AC85C9B802@OSBPR01MB2997.jpnprd01.prod.outlook.com>

On Mon, Apr 28, 2025 at 7:40 PM H Witt <[email protected]> wrote:

> select
> '2025-02-03 15:04:05'::*timestamptz* *at* *time* *zone* '+08:00',
> '2025-02-03 15:04:05'::*timestamptz* *at* *time* *zone* 'Asia/Shanghai'
>
> display
> |2025-02-02 23:04:05.000|2025-02-03 15:04:05.000|
>

When you write the former you get the POSIX convention for sign meaning (+
== West).  When you write the latter you get the ISO convention (+ == East)

https://www.postgresql.org/docs/current/datetime-posix-timezone-specs.html

Since people expect ISO conventions you should stick to using the zone
names and forget explicit offsets (and even the abbreviations for good
measure) even exist.

David J.


reply

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: why at time zone tz_offset not equal tz_name? tz_name has same offset in pg_timezone_names
  In-Reply-To: <CAKFQuwZgkaqZK5QNPceV090A4FW-PU384jbq_Tm6nt34-qeXYw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox