Re: JDBC Driver and timezones - Mailing list pgsql-jdbc

From Thomas Kellerer
Subject Re: JDBC Driver and timezones
Date
Msg-id ht01ae$9oq$1@dough.gmane.org
Whole thread Raw
In response to Re: JDBC Driver and timezones  (Thomas Kellerer <spam_eater@gmx.net>)
Responses Re: JDBC Driver and timezones
Re: JDBC Driver and timezones
List pgsql-jdbc
Thomas Kellerer, 19.05.2010 08:17:
>>> And for the test case the client application _and_ Postgres were
>>> running on the same physical machine. So the JVM (and thus the JDBC
>>> driver) and Postgres should use the same timezone information from my
>>> Windows.
>>
>> The JVM has its own separate timezone database. It does not use the
>> OS-provided timezone data in general.
>>
>
> Yes that's what I assume as well. But I'm still surprised the JVM
> doesn't apply the DST settings correctly (the timezone *is* correct)
>

Hmm, I just tested this and apparently my assumption is wrong (Java *is* using the correct DST setting)

When I run:

System.out.println("DST active: " + TimeZone.getDefault().useDaylightTime());
System.out.println("DST delta: " + TimeZone.getDefault().getDSTSavings());

it correctly shows me that the JDK knows that DST is active and that it should add one hour
(without setting a timezone when starting the JVM)

So either that information is not used by the JDK, or there is something going on in the driver.

Thomas

pgsql-jdbc by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: JDBC Driver and timezones
Next
From: Kris Jurka
Date:
Subject: Re: JDBC Driver and timezones