Re: TIMESTAMP with a timezone offset

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Madison Kelly <linux(at)alteeve(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: TIMESTAMP with a timezone offset
Date: 2008-12-16 19:24:06
Message-ID: 49480056.8070204@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)iol(dot)ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kretschmer 2008-12-16 19:51:30 Re: Isolating a record column from a PL-Pgsql function call ?
Previous Message Madison Kelly 2008-12-16 19:16:14 TIMESTAMP with a timezone offset