Re: [HACKERS] timezone problem?

Поиск
Список
Период
Сортировка
От Tatsuo Ishii
Тема Re: [HACKERS] timezone problem?
Дата
Msg-id 20000121105651T.t-ishii@sra.co.jp
обсуждение исходный текст
Ответ на Re: [HACKERS] timezone problem?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
> > HST is interpreted by Postgres as Hawaii Standard Time, which is on
> > the other side of the date line from Japan. Planning a vacation
> > Tatsuo?? :))

I wish I could do so:-) I hate the cold winter in Japan...

> Then there's still something wrong:
> 
> > test=> select '1998-09-23 12:05:10 HST'::datetime;
> > ------------------------------
> >  Wed Sep 23 22:05:10 1998 JST
> 
> 10 hours behind JST (= GMT+9, IIRC) is in the wrong ocean to be
> Hawaii...

Right. HST is GMT-10, and JST - HST = 19 hours. So '1998-09-23
12:05:10 HST' shoud be 'Thu Sep 24 07:05:10 1998 JST', rather than 'Wed
Sep 23 22:05:10 1998 JST'...

Looking into the zoneinfo files under /usr/share/zoneinfo, I found 'Japan'
as a valid zone name (I could not find 'JST' too on my RH box).

test=> select '1998-09-23 12:05:10 HST'::datetime;          ?column?           
------------------------------Thu Sep 24 07:05:10 1998 JST    -- correct
(1 row)

test=> set timezone to 'JST';
SET VARIABLE
test=> select '1998-09-23 12:05:10 HST'::datetime;          ?column?           
------------------------------Wed Sep 23 22:05:10 1998 JST    -- wrong. seems interpreted as GMT (UTC)
(1 row)

test=> set timezone to 'Japan';
SET VARIABLE
test=> select '1998-09-23 12:05:10 HST'::datetime;          ?column?           
------------------------------Thu Sep 24 07:05:10 1998 JST    -- correct. but why showed as JST?
(1 row)

test=> reset timezone;
RESET VARIABLE
test=> select '1998-09-23 12:05:10 HST'::datetime;          ?column?           
------------------------------Thu Sep 24 07:05:10 1998 JST    -- again, correct
(1 row)

Seems something wrong with my RH 5.2. Note that FreeBSD does have the
problem.
--
Tatsuo Ishii



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

Предыдущее
От: "Hiroshi Inoue"
Дата:
Сообщение: RE: [HACKERS] Some notes on optimizer cost estimates
Следующее
От: Tom Lane
Дата:
Сообщение: vacuum failure in current sources