Thread: convert timezone to string ...

convert timezone to string ...

From
"Marc G. Fournier"
Date:
I know that the server knows that ADT == -0400, and AST == -0300 ... is 
there any way of reversing that?  Basically, I want to say:

SELECT timezone_str(-0400, 'not dst');

and have it return ADT ... I've got a method of doing it right now, using 
a function, but just find it looks so messy, just wondering if there is a 
clean way of doing it ...

Thanks ...


Re: convert timezone to string ...

From
"Magnus Hagander"
Date:
> I know that the server knows that ADT == -0400, and AST ==
> -0300 ... is there any way of reversing that?  Basically, I
> want to say:
>
> SELECT timezone_str(-0400, 'not dst');
>
> and have it return ADT ... I've got a method of doing it
> right now, using a function, but just find it looks so messy,
> just wondering if there is a clean way of doing it ...
>
> Thanks ...

How would you know *which* timezone to go back to? For every hourly
offset there is a whole set of timezones that would result in it...

//Magnus


Re: convert timezone to string ...

From
Tom Lane
Date:
"Marc G. Fournier" <scrappy@postgresql.org> writes:
> I know that the server knows that ADT == -0400, and AST == -0300 ...

Other way around isn't it?  Unless Canada observes a pretty strange
variety of daylight saving time ;-)
        regards, tom lane


Re: convert timezone to string ...

From
"Marc G. Fournier"
Date:
On Tue, 25 Oct 2005, Tom Lane wrote:

> "Marc G. Fournier" <scrappy@postgresql.org> writes:
>> I know that the server knows that ADT == -0400, and AST == -0300 ...
>
> Other way around isn't it?  Unless Canada observes a pretty strange
> variety of daylight saving time ;-)

I knew I was going to get that backwards :(

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664