Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y3qFv-00040t-A8 for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Dec 2014 18:01:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y3qFu-0003kG-LZ for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Dec 2014 18:01:54 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y3qFs-0003k7-IS for pgsql-bugs@postgresql.org; Wed, 24 Dec 2014 18:01:52 +0000 Received: from hogranch.com ([75.101.82.47]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y3qFj-0000M6-SG for pgsql-bugs@postgresql.org; Wed, 24 Dec 2014 18:01:49 +0000 Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id sBOI1aH14463 for ; Wed, 24 Dec 2014 10:01:36 -0800 Message-ID: <549AFF7B.4070601@hogranch.com> Date: Wed, 24 Dec 2014 10:01:31 -0800 From: John R Pierce User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: Re: BUG #12326: I think maybe postgresql has a problem about timezone. References: <20141224095423.11501.9655@wrigleys.postgresql.org> <549A91A7.7000500@hogranch.com> <6076.1419433918@sss.pgh.pa.us> In-Reply-To: <6076.1419433918@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 12/24/2014 7:11 AM, Tom Lane wrote: >> # 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 we ran into this same problem in our java software (Java's Date object returning CST for China), and we fixed it via using some option in Java that output the time in an ISO format, like '2014-12-25 18:52:46+08', which removes all ambiguity. I'm not the Java programmer, so I don't know what the exact code fix was. -- john r pierce 37N 122W somewhere on the middle of the left coast -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs