Re: [HACKERS] timezone problem?

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: lockhart(at)alumni(dot)caltech(dot)edu, t-ishii(at)sra(dot)co(dot)jp, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] timezone problem?
Date: 2000-01-21 01:56:51
Message-ID: 20000121105651T.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-01-21 01:58:03 vacuum failure in current sources
Previous Message Hiroshi Inoue 2000-01-21 01:44:20 RE: [HACKERS] Some notes on optimizer cost estimates