Message-ID: From: "davecramer (@davecramer)" To: "pgjdbc/pgjdbc" Date: Thu, 21 Aug 2025 23:55:52 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #3692: Wrong time formatting ResultSet.getTime(); for Europe/Belgrade and "Europe/Prague" In-Reply-To: References: List-Id: X-GitHub-Author-Login: davecramer X-GitHub-Comment-Id: 3212494293 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 3692 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3692#issuecomment-3212494293 Content-Type: text/plain; charset=utf-8 So this is an artifact of how timestamptz is handled by postgres ``` set timezone to "America/Los_Angeles"; INSERT INTO t VALUES ('2023-11-10 09:00:00', '2023-11-10 09:00:00-08'), -- PST (UTC-8) ('2023-03-13 09:00:00', '2023-03-13 09:00:00-07'); -- PDT (UTC-7); INSERT 0 2 postgres=# table t; ts | tz ---------------------+------------------------ 2023-11-10 09:00:00 | 2023-11-10 09:00:00-08 2023-03-13 09:00:00 | 2023-03-13 09:00:00-07 (2 rows) postgres=# set timezone to gmt; SET postgres=# table t; ts | tz ---------------------+------------------------ 2023-11-10 09:00:00 | 2023-11-10 17:00:00+00 2023-03-13 09:00:00 | 2023-03-13 16:00:00+00 ``` Note the time that is stored in the second row is actually 1 hour earlier as. you had asked. It does not honour your UTC-7 as being the timezone for that insert it calculates the time `2023-03-13 09:00:00-07` and stores it in `America/Los_Angeles` timezone (well not really, it actually stores it in GMT) See what the time was when I set the session timezone to GMT! Postgres does not actually store a timezone with the timestamptz. it just takes whatever is in the column and displays it correctly for the current timezone.