How to make PostgreSQL JDBC drive get PGTZ? - Mailing list pgsql-general

From Raymond Chui
Subject How to make PostgreSQL JDBC drive get PGTZ?
Date
Msg-id 3A82F6C4.6BB60EEE@noaa.gov
Whole thread Raw
Responses Re: How to make PostgreSQL JDBC drive get PGTZ?  (Peter T Mount <peter@retep.org.uk>)
List pgsql-general
My system time zone (TZ) is set to US Eastern Standard Time is -5 hours
of
GMT time

I set
export PGTZ=GMT
then go to psql do

insert into a_table (a_column) values ('2001-02-08 18:30:00+00');
select a_column from a_table;

will get result exactly what I inserted
2001-02-08 18:30:00+00

But when I used JDBC drive from org.postgresql.Driver to insert the same
value,
I got

2001-02-08 23:30:00+00

This is the value of GMT time at 18:30 of EST time! Which tell me
the Postgres JDBC drive insert the value in EST time. Why is that?

I already did
Properties p = new Properties();
p.put("PGTZ", "GMT");
before connect to PostgreSQL server, but no luck!

Can someone out there tell me how to make PostgreSQL JDBC drive
get PGTZ environment variable effect?

Thank you very much in advance!

--Raymond


Attachment

pgsql-general by date:

Previous
From: Christopher Sawtell
Date:
Subject: Re: [SQL] Re: SQL Join - MySQL/PostgreSQL difference?
Next
From: clayton cottingham
Date:
Subject: Re: [SQL] Re: SQL Join - MySQL/PostgreSQL difference?