Re: Bug #651: Time difference of 30 in while reading in timestamp

Поиск
Список
Период
Сортировка
От R Ravishankar
Тема Re: Bug #651: Time difference of 30 in while reading in timestamp
Дата
Msg-id 1020313288.3cd0bec851bed@webmail4.maa.sify.net
обсуждение исходный текст
Ответ на Re: Bug #651: Time difference of 30 in while reading in timestamp  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Bug #651: Time difference of 30 in while reading in timestamp  (R Ravishankar <rravishankar@sify.com>)
Список pgsql-bugs
Actually the Timestamp class does not use Timezone. Timezone in Java 1.3 can be set only on Calendar class objects.
Timestampinherits some methods from the Date class but none which concerned with setting timezones :-( 

Ravi


 Tom Lane <tgl@sss.pgh.pa.us>:

> pgsql-bugs@postgresql.org writes:
> > I am using Java 1.3.1 and Postgres 7.1.2 and am writing timestamp
> without zone info to the database using JDBC (my zone is IST or
> +5:30GMT). I find that there is always a time difference of 30 minutes
> when i read from the database.
>
> > When i query the postgres database from the SQL prompt, the time is as
> i had written it. But when i read it from the database into my java code
> it is more exactly by 30 mins.
>
> I assume the datatype of the table column is "timestamp"?  The internal
> storage is in GMT, which is converted to the timezone specified by your
> current TimeZone setting whenever you SELECT the value.  If it works in
> psql then the database side of things seems to be okay.  I suspect that
> in the JDBC case, the backend's TimeZone variable is being set to
> something different than what you think it is (either +5 or +6, not
> 5:30).  Can you try a "SET TimeZone" to set the zone explicitly within
> your JDBC program, and see whether the results change?
>
>             regards, tom lane
>

-------------------------------------------------
Sify Mail - now with Anti-virus protection powered by Trend Micro, USA.
Know more at http://mail.sify.com

Take the shortest route to success!
Click here to know how http://education.sify.com

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

Предыдущее
От: "Nigel J. Andrews"
Дата:
Сообщение: createdb comments
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: LIKE Command