Search Postgresql Archives

Re: Timestamp with timezone query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hm?  Works for me:

postgres=# select time with time zone '00:30:00-05' at time zone 'utc';
  timezone
-------------
 05:30:00+00
(1 row)

What are you trying to do with the query?

--
Brandon Aiken
CS/IT Systems Engineer

-----Original Message-----
From: pgsql-general-owner@xxxxxxxxxxxxxx
[mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of Harry Hehl
Sent: Monday, September 25, 2006 5:34 PM
To: pgsql-general@xxxxxxxxxxxxxx
Subject: Re: [GENERAL] Timestamp with timezone query

Thanks, that does it. 
select * from table where column = '2006-02-10 19:30:00' AT TIME ZONE
'utc';

I also have a TIME WITH TIMEZONE column that I have to do the same thing
with but AT TIME ZONE can't be used directly. I tried several approaches
but I either get incorrect results or syntax errors. Is there a way to
do the same thing with TIME columns?

  

-----Original Message-----
From: Brandon Aiken [mailto:BAiken@xxxxxxxxxxxxxxx] 
Sent: Monday, September 25, 2006 11:39 AM
To: Harry Hehl; pgsql-general@xxxxxxxxxxxxxx
Subject: RE: [GENERAL] Timestamp with timezone query

Use the AT TIME ZONE construct:

http://www.postgresql.org/docs/8.1/interactive/functions-datetime.html#F
UNCTIONS-DATETIME-ZONECONVERT

--
Brandon Aiken
CS/IT Systems Engineer

-----Original Message-----
From: pgsql-general-owner@xxxxxxxxxxxxxx
[mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of Harry Hehl
Sent: Monday, September 25, 2006 11:06 AM
To: pgsql-general@xxxxxxxxxxxxxx
Subject: [GENERAL] Timestamp with timezone query

Hello,

I have a table with TIMESTAMP WITH TIMEZONE column. I would like to
query for a timestamp using a different timezone.

For example if a column contains '2006-02-11 00:30:00-05' 
select * from table where column='2006-02-10 19:30:00+00' would return
the column containing '2006-02-11 00:30:00-05'.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux