Re: BUG #12326: I think maybe postgresql has a problem about timezone. - Mailing list pgsql-bugs

From Jeff Janes
Subject Re: BUG #12326: I think maybe postgresql has a problem about timezone.
Date
Msg-id CAMkU=1xZULVuL9PsMEdy5N9cvdkBKL61Wv4z_sHnB6BrVCwmoQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #12326: I think maybe postgresql has a problem about timezone.  (张亚琪 <zhangyingyun001@gmail.com>)
List pgsql-bugs
On Wed, Dec 24, 2014 at 3:15 AM, =E5=BC=A0=E4=BA=9A=E7=90=AA <zhangyingyun0=
01@gmail.com> wrote:

> hi John,
>
>           Thank you for your reply. I am in China.
>           You can look at my result as following:
>
> show timezone;
>
> TimeZone
>
> ----------
>
>  PRC
>
> (1 row)
>
>
>
>
> # update history_configuration set var_datetime =3D 'Wed Dec 24 18:52:46 =
CST
>> 2014' where var_name =3D 'lastHourAggr';
>
>
>
> # select * from history_configuration ;
>
>      var_name      | var_value |      var_datetime
>
> -------------------+-----------+------------------------
>
>  lastHourAggr      |           | 2014-12-25 08:52:46+08
>
>
> So I think this CST means Central Standard Time , right?  And then when I
> read data using select sql, it will show this time with postgresql timezo=
ne.
>
>
PostgreSQL does not remember what timezone the time was expressed as when
you inserted it.  Rather, it interprets the date as being expressed in the
indicated time zone, and translates it to universal time for storage.  (If
you didn't indicate a time zone in the string itself, then it interprets it
as being from the timezone the client has set to),  When you pull the date
back out, it translates it from universal time to whatever your local
timezone is set to, which in this case is PRC (aka +8).

Cheers,

Jeff

pgsql-bugs by date:

Previous
From: 张亚琪
Date:
Subject: Re: BUG #12326: I think maybe postgresql has a problem about timezone.
Next
From: Tom Lane
Date:
Subject: Re: BUG #12326: I think maybe postgresql has a problem about timezone.