Re: JDBC Driver and timezones
| От | Thomas Kellerer |
|---|---|
| Тема | Re: JDBC Driver and timezones |
| Дата | |
| Msg-id | ht01ae$9oq$1@dough.gmane.org обсуждение исходный текст |
| Ответ на | Re: JDBC Driver and timezones (Thomas Kellerer <spam_eater@gmx.net>) |
| Ответы |
Re: JDBC Driver and timezones
Re: JDBC Driver and timezones |
| Список | 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 по дате отправления: