Re: [HACKERS] timezone problem?
От | Thomas Lockhart |
---|---|
Тема | Re: [HACKERS] timezone problem? |
Дата | |
Msg-id | 3887EE8C.5A2E0044@alumni.caltech.edu обсуждение исходный текст |
Ответ на | Re: [HACKERS] timezone problem? (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: [HACKERS] timezone problem?
(Tatsuo Ishii <t-ishii@sra.co.jp>)
Re: [HACKERS] timezone problem? (Vince Vielhaber <vev@michvhf.com>) |
Список | pgsql-hackers |
Tatsuo Ishii wrote: > > > 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) That is typical when you use the long form of the time zone name such as "Japan". You will also find a "US/Pacific" on your machine: [root@golem zoneinfo]# setenv TZ US/Pacific [root@golem zoneinfo]# date Thu Jan 20 21:24:24 PST 2000 which is the same as PST8PDT. In /usr/share/zoneinfo/US, the mysteries of the various states' conventions are revealed: [root@golem zoneinfo]# ls -1 US Alaska Aleutian Arizona Central East-Indiana Eastern Hawaii Indiana-Starke Michigan Mountain Pacific Samoa where, as Vince pointed out, Indiana, Michigan, and Arizona seem to be special cases within the usual three timezones. > Seems something wrong with my RH 5.2. Note that FreeBSD does have the > problem. Sorry, FreeBSD also has the problem, or does not?? - Thomas -- Thomas Lockhart lockhart@alumni.caltech.edu South Pasadena, California
В списке pgsql-hackers по дате отправления: