Skip site navigation (1) Skip section navigation (2)

Re: JDBC Driver and timezones

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC Driver and timezones
Date: 2010-05-19 06:43:40
Message-ID: ht01ae$9oq$ (view raw, whole thread or download thread mbox)
Lists: 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.


In response to


pgsql-jdbc by date

Next:From: Marc MaminDate: 2010-05-19 07:18:42
Subject: Re: JDBC Driver and timezones
Previous:From: Thomas KellererDate: 2010-05-19 06:17:22
Subject: Re: JDBC Driver and timezones

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group