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

Re: Timestamp without timezone issue

From: Kris Jurka <books(at)ejurka(dot)com>
To: Chip Gobs <chip(dot)gobs(at)noaa(dot)gov>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Timestamp without timezone issue
Date: 2007-12-05 15:53:11
Message-ID: Pine.BSO.4.64.0712051048150.24930@leary.csoft.net (view raw or flat)
Thread:
Lists: pgsql-jdbc

On Tue, 4 Dec 2007, Chip Gobs wrote:

> We recently changed from using PostgreSQL 7.4.8 to 8.2.5 and switched the 
> JDBC driver to the 8.2.506 version from the  74.215 version. We are and have 
> been using build 1.5.0_04-b05 of the J2SE since before our Postgres version 
> change.
>
> The column obstime is of type timestamp without timezone.   After using psql 
> to experiment, it appears that the   -06 is being ignored and the time in the 
> value assignment part of the update statement  is being considered as 
> 10:00:00 UTC instead of 16:00:00 UTC.
>
> The following did not work:
>
> TimeZone tz = TimeZone.getTimeZone("UTC");
> Calendar cal = Calendar.getInstance(tz);
> Timestamp timestamp = new Timestamp(timeInMillis);
> statement.setTimestamp(index, timestamp , cal);
>

Could you be more clear on why this doesn't work?  The attached test case 
seems like it is working as you desire.

Kris Jurka

Attachment: TS.java
Description: text/plain (965 bytes)

In response to

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2007-12-05 15:56:37
Subject: Re: BatchUpdate exception
Previous:From: Kranti K K Parisa [GetSet-India]Date: 2007-12-05 15:52:31
Subject: Re: BatchUpdate exception

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