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

Re: ResultSet.getTimestamp(Calendar) off by one-hour

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Roland Roberts <roland(at)astrofoto(dot)org>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ResultSet.getTimestamp(Calendar) off by one-hour
Date: 2009-03-13 20:16:35
Message-ID: 4747.1236975395@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-jdbc
Roland Roberts <roland(at)astrofoto(dot)org> writes:
> And here is what is in the database:

>     roland=# select * from mytable;
>      id |       mytime       
>     ----+---------------------
>      12 | 2009-03-13 15:00:00
>     (1 row)

Apparently you're using a timestamp WITHOUT time zone column to store
the data.  Not recommended if you are worried about timezone effects,
since by definition the apparent value depends on caller's timezone
context.  Use timestamp WITH time zone and see if it gets better.

			regards, tom lane

In response to

Responses

pgsql-jdbc by date

Next:From: Roland RobertsDate: 2009-03-13 20:31:40
Subject: Re: ResultSet.getTimestamp(Calendar) off by one-hour
Previous:From: Roland RobertsDate: 2009-03-13 20:14:28
Subject: Re: ResultSet.getTimestamp(Calendar) off by one-hour

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