Re: problem with dates when using a java calendar object with

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: problem with dates when using a java calendar object with
Дата
Msg-id Pine.BSO.4.56.0410140656260.19030@leary.csoft.net
обсуждение исходный текст
Ответ на problem with dates when using a java calendar object with a non-default timezone  (Jair da Silva Ferreira Jr <j2@amazon.com.br>)
Ответы Re: problem with dates when using a java calendar object with  (Jair da Silva Ferreira Jr <j2@amazon.com.br>)
Список pgsql-jdbc

On Wed, 13 Oct 2004, Jair da Silva Ferreira Jr wrote:

> I don't care about the time (hour, minute and second)
> difference as this is a SQL DATE type. The problem is that the days in
> these dates are different.

There are a number of problems going on here:

First the JDBC driver didn't support using an alternate Calendar until
very recently.  This functionality is only in the 8.0 series.

Second it doesn't make sense to store a timezone with a date alone.  You
need time information as well, so you've selected the wrong pg datatype
"date" and should probably be using "timestamp with time zone".

Finally the javadoc says

    To conform with the definition of SQL DATE, the millisecond values
    wrapped by a java.sql.Date instance must be 'normalized' by
    setting the hours, minutes, seconds, and milliseconds to zero in
    the particular time zone with which the instance is associated.

I believe this means your whole setTimeInDate method is not legal.

Kris Jurka

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: tightening up on use of oid 0
Следующее
От: Paul Thomas
Дата:
Сообщение: Re: PostgreSQL Database interfaced by Java Applet