| From: | Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> |
|---|---|
| To: | Anibal David Acosta <aa(at)devshock(dot)com> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: timezone, how postgres deal with it? |
| Date: | 2012-11-20 22:19:47 |
| Message-ID: | 50AC0203.4010604@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On 11/20/2012 01:48 PM, Anibal David Acosta wrote:
> This query returns false
>
> select ('2012-11-20 17:00:00-02:00'::timestamp with time zone) =
> ('2012-11-20 18:00:00-03:00'::timestamp with time zone)
>
> Why?
>
> Does postgres convert the datetime or just show/hide time zone?
>
Try:
test=> select ('2012-11-20 17:00:00+02:00'::timestamp with time zone) = ('2012-11-20 18:00:00+03:00'::timestamp with time zone);
?column?
----------
t
(1 row)
For explanation see:
http://www.postgresql.org/docs/9.2/interactive/datatype-datetime.html#DATATYPE-TIMEZONES
--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Adrian Klaver | 2012-11-20 22:23:08 | Re: get column name passed to a function |
| Previous Message | Tom Lane | 2012-11-20 22:14:42 | Re: timezone, how postgres deal with it? |