How to ensure GMT time zone for Timestamp in PostgreSQL?

Поиск
Список
Период
Сортировка
От Raymond Chui
Тема How to ensure GMT time zone for Timestamp in PostgreSQL?
Дата
Msg-id 3A82C01C.30DD8845@noaa.gov
обсуждение исходный текст
Список pgsql-general
I run PostgreSQL 7.0.3 on my Redhat Linux 6.x

I have to export the system time zone to TZ=EDT.

Then I export PGTZ=GMT

If I insert or update a row in a Timestamp column,
I will get GMT time zone by

select a_timestamp_column from a_table;

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

But if the PGTZ is not set, then I will get result
2001-02-08 08:30:00-05

Correct?
How do I always get GMT time zone when I select, insert and update?
Should I export PGTZ=GMT before start the PostgreSQL server?

Thank you!


--Raymond


Вложения

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

Предыдущее
От: Shahab Asgharzadeh
Дата:
Сообщение: Re: numeric type and odbc from access 2000
Следующее
От: Mitch Vincent
Дата:
Сообщение: Varchar and indexing..