Re: How to make PostgreSQL JDBC drive get PGTZ?

From: Barry Lind <barry(at)xythos(dot)com>
To: Raymond Chui <raymond(dot)chui(at)noaa(dot)gov>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: How to make PostgreSQL JDBC drive get PGTZ?
Date: 2001-02-12 21:46:55
Message-ID: 3A8859CF.3070701@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc

What version of the database and jdbc driver are you using? This should
be fixed and work correctly in current sources.

thanks,
--Barry

Raymond Chui wrote:

> 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2001-02-12 21:47:30 Re: Howto install postgresql 7.03 on Darwin 1.2
Previous Message Fred Yankowski 2001-02-12 21:40:33 Re: ALTER DROP COLUMN

Browse pgsql-jdbc by date

  From Date Subject
Next Message Jouni Ahto 2001-02-12 23:19:26 Re: [PHP-DEV] Re: Re: PostgreSQL and PHP persistent connections
Previous Message Brice Ruth 2001-02-12 19:57:43 Re: (Update) Implicit smallint to boolean conversion?