public inbox for [email protected]
help / color / mirror / Atom feedFrom: H Witt <[email protected]>
To: Bruce Momjian <[email protected]>
Cc: [email protected] <[email protected]>
Subject: =?gb2312?B?u9i4tDogd2h5IGF0IHRpbWUgem9uZSB0el9vZmZzZXQgbm90IGVxdWFsIHR6?= =?gb2312?B?X25hbWU/ICB0el9uYW1lIGhhcyBzYW1lIG9mZnNldCBpbiBwZ190aW1lem9u?= =?gb2312?Q?e=5Fnames?=
Date: Tue, 29 Apr 2025 06:28:05 +0000
Message-ID: <OSBPR01MB29978241F67EB78F0390C6809B802@OSBPR01MB2997.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <[email protected]>
References: <OSBPR01MB299716C895A69A6DFCF3357C9B812@OSBPR01MB2997.jpnprd01.prod.outlook.com>
<OSBPR01MB29975FFDA1D860B20A8AC85C9B802@OSBPR01MB2997.jpnprd01.prod.outlook.com>
<[email protected]>
Hi all,
Thanks for explaining. I have got it.
________________________________
发件人: Bruce Momjian <[email protected]>
发送时间: 2025年4月29日 11:09
收件人: H Witt <[email protected]>
抄送: [email protected] <[email protected]>
主题: Re: why at time zone tz_offset not equal tz_name? tz_name has same offset in pg_timezone_names
On Tue, Apr 29, 2025 at 02:40:45AM +0000, H Witt 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|
The sign is wrong in the first column:
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'
;
timezone | timezone
---------------------+---------------------
2025-02-04 04:04:05 | 2025-02-04 04:04:05
See:
https://www.postgresql.org/docs/current/datetime-posix-timezone-specs.html
The offset fields specify the hours, and optionally minutes and
seconds, difference from UTC. They have the format hh[:mm[:ss]]
optionally with a leading sign (+ or -). The positive sign is used
for zones west of Greenwich. (Note that this is the opposite of
the ISO-8601 sign convention used elsewhere in PostgreSQL.) hh
can have one or two digits; mm and ss (if used) must have two.
--
Bruce Momjian <[email protected]> https://momjian.us
EDB https://enterprisedb.com
Do not let urgent matters crowd out time for investment in the future.
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: =?gb2312?B?u9i4tDogd2h5IGF0IHRpbWUgem9uZSB0el9vZmZzZXQgbm90IGVxdWFsIHR6?= =?gb2312?B?X25hbWU/ICB0el9uYW1lIGhhcyBzYW1lIG9mZnNldCBpbiBwZ190aW1lem9u?= =?gb2312?Q?e=5Fnames?=
In-Reply-To: <OSBPR01MB29978241F67EB78F0390C6809B802@OSBPR01MB2997.jpnprd01.prod.outlook.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