How to make PostgreSQL JDBC drive get PGTZ?

Поиск
Список
Период
Сортировка
От Raymond Chui
Тема How to make PostgreSQL JDBC drive get PGTZ?
Дата
Msg-id 3A82F6C4.6BB60EEE@noaa.gov
обсуждение исходный текст
Ответы Re: How to make PostgreSQL JDBC drive get PGTZ?
Список 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


Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Christopher Sawtell
Дата:
Сообщение: Re: [SQL] Re: SQL Join - MySQL/PostgreSQL difference?
Следующее
От: clayton cottingham
Дата:
Сообщение: Re: [SQL] Re: SQL Join - MySQL/PostgreSQL difference?