Re: time - Mailing list pgsql-sql

From Michael Fuhr
Subject Re: time
Date
Msg-id 20051110182139.GA87715@winnie.fuhr.org
Whole thread Raw
In response to Re: time  (Rod Taylor <pg@rbt.ca>)
Responses Re: time
Re: time
List pgsql-sql
On Thu, Nov 10, 2005 at 01:11:27PM -0500, Rod Taylor wrote:
> rbt=# select cast(now() - date_trunc('day', now()) as time);
>       time
> -----------------
>  13:10:42.495579
> (1 row)

Am I missing something?  Is there a reason not to simply cast the
timestamp value to time?

test=> select cast(now() - date_trunc('day', now()) as time);       time         
---------------------11:19:19.8921250105
(1 row)

test=> select now()::time;      now       
-----------------11:19:19.892125
(1 row)

test=> select cast(now() as time);      now       
-----------------11:19:19.892125
(1 row)

-- 
Michael Fuhr


pgsql-sql by date:

Previous
From: Rod Taylor
Date:
Subject: Re: time
Next
From: Rod Taylor
Date:
Subject: Re: time