agora inbox for pljava-dev@postgresql.org
help / color / mirror / Atom feedSubject: [Pljava-dev] date handling...
Date: 17 Aug 2005 22:46:28 -0500
Message-ID: <1124336789.2862.7.camel@sat1> (raw)
In-Reply-To: <thhal-0lZXaA8nb77QjhhwfRSXknpOHCNVrQP@mailblocks.com>
References: <1123994718.4039.9.camel@sat1>
<42FEFD13.50105@mailblocks.com>
<thhal-0lZXaA8nb77QjhhwfRSXknpOHCNVrQP@mailblocks.com>
Thanks for the response Thomas.
The timezones are indeed different. show all from psql shows Time Zone
as 'undefined'. The jvm returns CST6CDT.
We forced the timezone in the db server to 'CST6CDT' and the one 1 day
difference is still there.
We set the timezone in the db server to 'GMT' and pl/java returns the
correct date, no 1 day difference at all.
I think I read somewhere that it is a good practice to set the db server
time to GMT and let the client specify the client's timezone. We are now
in the process of testing our db server/client software to interact
against db servers running in GMT, seems to be the choice most people
use.
Thanks again.
george
On Sun, 2005-08-14 at 03:13, Thomas Hallgren wrote:
> George,
> This is probably a bug. PL/Java has to do some adjustements in order to
> get java.sql.Date to work correctly but something is obviously wrong.
>
> A java.sql.Date in java extends from java.util.Date. It's internal
> representation is in milliseconds since midnight 1970-01-01. If the
> timezone used by your server differs from the one that the JVM uses,
> "midnight" may be translated some time in the evening the day before.
>
> Can you please print the timezone that your server uses and the timezone
> that the JVM thinks it has, i.e. TimeZone.getDefault() and see if
> there's a differenence?
>
> Regards,
> Thomas Hallgren
view thread (3+ messages)
Message-ID: <1124336789.2862.7.camel@sat1>
Permalink: ../1124336789.2862.7.camel@sat1/
Also on: postgresql.org/message-id/1124336789.2862.7.camel@sat1
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: pljava-dev@postgresql.org
Subject: Re: [Pljava-dev] date handling...
In-Reply-To: <1124336789.2862.7.camel@sat1>
* 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