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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-jdbc by date

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