Strange timezone issue on Freebsd

From: "Jan Aleman" <jaleman(at)profdata(dot)nl>
To: "'pgsql-jdbc'" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Strange timezone issue on Freebsd
Date: 2002-03-18 20:21:52
Message-ID: 000001c1ceba$8b3882e0$2b01000a@jaleman
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Strange timezone issue on Freebsd

Setup:

FreeBSD 4.5
JDK 1.4 (linux port)
Postgresql: 7.1
Timezone on server: CET (GMT+1)
(additionally also TZ=CET in environment)

TABLE:

Table "supplier_avail"
Attribute | Type | Modifier
-------------------+--------------------------+----------
supplier_avail_id | integer | not null
supplier_id | integer | not null
weekday | integer | not null
start_time | timestamp with time zone |
end_time | timestamp with time zone |
Index: supplier_avail_pkey

The query (when executed from psql):

SELECT MIN(start_time) from supplier_avail where supplier_id = 1023 and
weekday = 2

Returns:

2001-01-01 09:00:00+01

Now the problem:
Consider the following Java snippet:

IContentList openCL = cm.getContentByQuery(
" SELECT"+
" MIN(start_time)"+
" from supplier_avail where supplier_id =
"+supplier_id+" and weekday = "+weekday,1);
out.print(openCL.getValueAt(0,0));

returns:
2001-01-01 08:00:00.0

The funny thing is if I connect from my Windows XP machine (Timezone
also at GMT +1) the time I really want (09:00) is returned.

I have scanned through the docs but was unable to find out if I'm doing
something wrong.

Thanks for helping me out

Jan Aleman

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Jan Aleman 2002-03-18 22:19:26 Re: Strange timezone issue on Freebsd
Previous Message Dave Cramer 2002-03-18 19:20:13 Re: mishandling of NOTICE?