now() AT TIME ZONE interval '-5 hours' returns type interval??? - Mailing list pgsql-general

From Joshua Moore-Oliva
Subject now() AT TIME ZONE interval '-5 hours' returns type interval???
Date
Msg-id 200303132037.47678.josh@chatgris.com
Whole thread Raw
Responses Re: now() AT TIME ZONE interval '-5 hours' returns type interval??? -- more info, looks like a postgres bug  (Joshua Moore-Oliva <josh@chatgris.com>)
Re: now() AT TIME ZONE interval '-5 hours' returns type interval???  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I am attempting to work with time zones.  All of my timestamp fields are

timestamp with time zone

The problem I am having is when I attempt to convert a timestamp with a time
zone to another time zone.  For example, the statement

SELECT now() AT TIME ZONE interval '-5 hours'

returns type interval not timestamp with//out time zone.

On my website I have people select the timezone they are in..

That way I can theoritically perform an insert along the lines of

timestamp '2003-12-03 19:34' AT TIME ZONE interval '-5 hours'

replacing -5 with whatever timezone they specify.

I am hoping to be able to do the reverse,

SELECT stamp AT TIME ZONE interval '-5 hours' FROM table;

However it returns type interval!!!  And casting it to type timestamp does not
work.

Help!

Josh.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: ~*, case insensitiveness and national chars
Next
From: Joshua Moore-Oliva
Date:
Subject: Re: now() AT TIME ZONE interval '-5 hours' returns type interval??? -- more info, looks like a postgres bug