pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: stan@marencik.cz
Subject: BUG #16060: JDBC - badly gets DateOffsetTime value from database
Date: Tue, 15 Oct 2019 18:52:12 +0000
Message-ID: <16060-de59c53943ddc082@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      16060
Logged by:          Jan Marencik
Email address:      stan@marencik.cz
PostgreSQL version: 12.0
Operating system:   Ubuntu
Description:        

postgresql 42.2.8

Java DateOffsetTime value correctly stored to database to timestamptz. I see
right conversion to string including right time zone.
Opposite process doesn't get the right DateOffsetTime value from database.
In my case the string representation stored to database is 2019-10-15
20:26:41.391055+02 but I get 2019-10-15T18:26:41.391055Z which doesn't by +2
hours which is my time zone.
I think the bug is in TimestampUtils line 513:
    // Postgres is always UTC
    OffsetDateTime result = OffsetDateTime.of(ts.year, ts.month, ts.day,
ts.hour, ts.minute, ts.second, ts.nanos, zoneOffset)
        .withOffsetSameInstant(ZoneOffset.UTC);
The last line ".withOffsetSameInstant(ZoneOffset.UTC);" is the bug



view thread (4+ messages)  latest in thread

Message-ID: <16060-de59c53943ddc082@postgresql.org>
Permalink:  ../16060-de59c53943ddc082@postgresql.org/
Also on:    postgresql.org/message-id/16060-de59c53943ddc082@postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, stan@marencik.cz
  Subject: Re: BUG #16060: JDBC - badly gets DateOffsetTime value from database
  In-Reply-To: <16060-de59c53943ddc082@postgresql.org>
  References: <16060-de59c53943ddc082@postgresql.org>

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

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