pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: 张亚琪 <zhangyingyun001@gmail.com>
Cc: John R Pierce <pierce@hogranch.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #12326: I think maybe postgresql has a problem about timezone.
Date: Wed, 24 Dec 2014 10:11:58 -0500
Message-ID: <6076.1419433918@sss.pgh.pa.us> (raw)
In-Reply-To: <CAGxTSnZbW4e6uFjkLEA4vBPm6Ay1Ez3RWu5h=5-KfSkLDvYK_A@mail.gmail.com>
References: <20141224095423.11501.9655@wrigleys.postgresql.org>
	<549A91A7.7000500@hogranch.com>
	<CAGxTSnZbW4e6uFjkLEA4vBPm6Ay1Ez3RWu5h=5-KfSkLDvYK_A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

=?UTF-8?B?5byg5Lqa55Cq?= <zhangyingyun001@gmail.com> writes:
> show timezone;
> TimeZone
> ----------
>  PRC
> (1 row)

> # update history_configuration set var_datetime = 'Wed Dec 24 18:52:46 CST
>> 2014' where var_name = 'lastHourAggr';

> # select * from history_configuration ;
>      var_name      | var_value |      var_datetime
> -------------------+-----------+------------------------
>  lastHourAggr      |           | 2014-12-25 08:52:46+08

As John says, this behavior is perfectly expected because Postgres thinks
"CST" means US Central Standard Time (GMT-6, currently).

If you want CST to mean China Standard Time, you'll need to set up a
custom zone abbreviation file.  See
http://www.postgresql.org/docs/9.3/static/datetime-config-files.html

For some reason this interpretation of "CST" got missed out when preparing
the sample data in Asia.txt, but I think what you need is just

@INCLUDE Default
@OVERRIDE
CST  28800

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (6+ messages)  latest in thread

Message-ID: <6076.1419433918@sss.pgh.pa.us>
Permalink:  ../6076.1419433918@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6076.1419433918@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, zhangyingyun001@gmail.com, pierce@hogranch.com
  Subject: Re: BUG #12326: I think maybe postgresql has a problem about timezone.
  In-Reply-To: <6076.1419433918@sss.pgh.pa.us>
  References: <20141224095423.11501.9655@wrigleys.postgresql.org> <549A91A7.7000500@hogranch.com> <CAGxTSnZbW4e6uFjkLEA4vBPm6Ay1Ez3RWu5h=5-KfSkLDvYK_A@mail.gmail.com> <6076.1419433918@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox