Re: TIME column manipulation/comparison hangups - Mailing list pgsql-general

From Scott Marlowe
Subject Re: TIME column manipulation/comparison hangups
Date
Msg-id dcc563d10811031111o2035abf4w7596f8f21c42f9c3@mail.gmail.com
Whole thread Raw
In response to TIME column manipulation/comparison hangups  (Bill Moran <wmoran@collaborativefusion.com>)
Responses Re: TIME column manipulation/comparison hangups  (Bill Moran <wmoran@collaborativefusion.com>)
List pgsql-general
On Mon, Nov 3, 2008 at 12:01 PM, Bill Moran
<wmoran@collaborativefusion.com> wrote:
>
> I'm trying to test the time in a time column to see if it's the same
> minute as the current time.  I wouldn't have thought this would be
> difficult:
>
> WHERE TO_CHAR(now(), 'HH24MI') = TO_CHAR(time_column, 'HH24MI')

Use date_trunc

where date_trunc('minute',timefield)=date_trunc('minute',now());

I might have the args backwards.

pgsql-general by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: TIME column manipulation/comparison hangups
Next
From: Alan Hodgson
Date:
Subject: Re: Debugging infrequent pegged out CPU usage