Re: automatic time zone conversion

From: Ken Williams <ken(at)mathforum(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: automatic time zone conversion
Date: 2002-06-13 00:17:35
Message-ID: F6278CBE-7E62-11D6-8497-0003936C1626@mathforum.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Wednesday, June 12, 2002, at 11:57 PM, Tom Lane wrote:

> Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
>> Hmm, postgresql knows about daylight savings if your c library
>> knows about
>> it. I'm not exactly sure how it works but you should
>> investigate the PGTZ
>> environment variables. This is what happens on my 7.2.1 system:
>
>> select '02/06/2002 12:00:00 AEST'::timestamp;
>> timestamptz
>> ------------------------
>> 2002-06-02 12:00:00+10
>> (1 row)
>
>> select '02/03/2002 12:00:00 AEST'::timestamp;
>> timestamptz
>> ------------------------
>> 2002-03-02 13:00:00+11
>> (1 row)
>
>> which seems wrong to me...
>
> Looks okay to me. Since you specified the zone in both cases, you got
> the same time-of-day in GMT terms in both cases. The stored internal
> form was 02:00 GMT on each date (assuming your machine thinks that AEST
> is GMT+10, like mine does). That was then rotated to your own local
> time zone (evidently +10/+11) for display purposes.

What seems strange to me is that '02/03/2002 12:00:00 AEST' has
any meaning at all. On March 2, Australia is observing DST, but
AEST is Standard Time. Shouldn't there at least be a warning
when trying to insert a date that doesn't exist?

The results for '02/06/2002 12:00:00 AEST' look correct, because
the time zone matches the reality.

-Ken

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-06-13 02:24:51 Re: automatic time zone conversion
Previous Message Stephan Szabo 2002-06-13 00:17:31 Re: Troubleshooting SPI_execp() failed in RI_FKey_cascade_del()