Re: TIMESTAMP with a timezone offset - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: TIMESTAMP with a timezone offset
Date
Msg-id 49480056.8070204@iol.ie
Whole thread Raw
In response to TIMESTAMP with a timezone offset  (Madison Kelly <linux@alteeve.com>)
Responses Re: TIMESTAMP with a timezone offset  (Madison Kelly <linux@alteeve.com>)
List pgsql-general
On 16/12/2008 19:16, Madison Kelly wrote:
>   I want to say in my WHERE clause to offset the value I am giving by X
> number of hours and to display the column I've cast as a timestamp
> offset by the same X hours.

You could use AT TIME ZONE to shift it the required number of hours:

http://www.postgresql.org/docs/8.3/static/functions-datetime.html#FUNCTIONS-DATETIME-ZONECONVERT

I hope this helps.

Ray.


------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

pgsql-general by date:

Previous
From: Madison Kelly
Date:
Subject: TIMESTAMP with a timezone offset
Next
From: Andreas Kretschmer
Date:
Subject: Re: Isolating a record column from a PL-Pgsql function call ?