Обсуждение: timezone, how postgres deal with it?

Поиск
Список
Период
Сортировка

timezone, how postgres deal with it?

От
"Anibal David Acosta"
Дата:

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)

 

But are exactly same time

 

Why?

 

timestamp with timezone just show/hide time zone?

 

thanks

 

 

Re: timezone, how postgres deal with it?

От
Tom Lane
Дата:
"Anibal David Acosta" <aa@devshock.com> writes:
> 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)
> But are exactly same time

No, they aren't.  You're apparently still confused about the sign of
timezone offsets.  The first one corresponds to 19:00 GMT, the second
to 21:00 GMT.

BTW, why are you posting the exact same question you posted two days
ago on another list?

            regards, tom lane


Re: timezone, how postgres deal with it?

От
"Albe Laurenz"
Дата:
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)
>
> But are exactly same time
>
> Why?

They are not the same.  Compare:

select ('2012-11-20 17:00:00-02:00'::timestamp with time zone) =
('2012-11-20 16:00:00-03:00'::timestamp with time zone)

That will return true.

Yours,
Laurenz Albe