How to make PostgreSQL JDBC drive get PGTZ?

From: Raymond Chui <raymond(dot)chui(at)noaa(dot)gov>
To: pgsql-general(at)postgresql(dot)org
Subject: How to make PostgreSQL JDBC drive get PGTZ?
Date: 2001-02-08 19:43:00
Message-ID: 3A82F6C4.6BB60EEE@noaa.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc


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 Content-Type Size
raymond.chui.vcf text/x-vcard 421 bytes

Responses

Browse pgsql-general by date

  From Date Subject
Next Message mitch 2001-02-08 21:04:38 Varchar Indexing
Previous Message Tom Lane 2001-02-08 19:00:00 Re: Fw: [PHP] Fooling the query optimizer

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thies C. Arntzen 2001-02-09 13:41:54 Re: PostgreSQL and PHP persistent connections
Previous Message Bruce Momjian 2001-02-08 14:18:25 Re: Re: PostgreSQL and PHP persistent connections