TIMESTAMP with a timezone offset - Mailing list pgsql-general

From Madison Kelly
Subject TIMESTAMP with a timezone offset
Date
Msg-id 4947FE7E.30000@alteeve.com
Whole thread Raw
Responses Re: TIMESTAMP with a timezone offset
List pgsql-general
Hi all,

   I've got a database with a column I CAST as a TIMESTAMP. The data in
the database is GMT.

   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.

   I am sure this is possible, and probably fairly simple. :)

Here a simplified query I am using that currently has no TZ data:

'bar' is a timestamp from the system, 'baz' is a string from an external
source CAST as a timestamp.

SELECT
   foo,
   bar,
   CAST (baz AS TIMESTAMP) AS last_state_change
FROM
   history.table
WHERE
   bar >= '2008-12-15 14:01:09' AND foo=153;

Thanks!

Madi

pgsql-general by date:

Previous
From: "Emanuel Calvo Franco"
Date:
Subject: Re: Trigger/Rules Order of operations
Next
From: Raymond O'Donnell
Date:
Subject: Re: TIMESTAMP with a timezone offset