agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] Has ResultSet.getDate() correct handling DayLight saving time?
Date: Fri, 31 Mar 2006 02:04:42 +0600
Message-ID: <ce6becd90603301204p4ad121dcna667b89621661b17@mail.gmail.com> (raw)

Hi all!
I have a little trouble with my pljava functions last night:(
--------------
here config:
Java HotSpot(TM) Server VM (build 1.5.0_06-b05, mixed mode)
Debian Sarge
pljava 1.2.0 compiled from source
postgresql 8.1.3 installed from debian backports
---------------
ResultSet.getDate for  to_date('01/11/2005','DD/MM/YYYY') returns
31/10/2005 for pljava jdbc driver
the same java code using postgresql jdbc driver works  fine:(

I discovered that wrong result depend on DayLight Saving time
and i wrote workaround on ObjectResultSet.getDate()

	public Date getDate(int columnIndex)
	throws SQLException
	{
		Date d = (Date)this.getValue(columnIndex,Date.class);
		if(!java.util.TimeZone.getDefault().inDaylightTime(d)){
                    d = new
java.sql.Date(d.getTime()+java.util.TimeZone.getDefault().getDSTSavings());
                }
		return d;
	}

now my pljava code works good, but that's wrong way:(
What are you comments, developers?:)
PS: sorry for my English,I am Russian:)




view thread (5+ messages)  latest in thread

Message-ID: <ce6becd90603301204p4ad121dcna667b89621661b17@mail.gmail.com>
Permalink:  ../ce6becd90603301204p4ad121dcna667b89621661b17@mail.gmail.com/
Also on:    postgresql.org/message-id/ce6becd90603301204p4ad121dcna667b89621661b17@mail.gmail.com

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] Has ResultSet.getDate() correct handling DayLight saving time?
  In-Reply-To: <ce6becd90603301204p4ad121dcna667b89621661b17@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