Re: time

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Rod Taylor <pg(at)rbt(dot)ca>
Cc: Judith Altamirano Figueroa <jaltamirano(at)correolux(dot)com(dot)mx>, pgsql-sql(at)postgresql(dot)org
Subject: Re: time
Date: 2005-11-10 18:21:39
Message-ID: 20051110182139.GA87715@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

  • Re: time at 2005-11-10 18:11:27 from Rod Taylor

Responses

  • Re: time at 2005-11-10 18:27:10 from Rod Taylor
  • Re: time at 2005-11-10 18:38:12 from Michael Fuhr
  • Re: time at 2005-11-10 19:13:43 from Tom Lane

Browse pgsql-sql by date

  From Date Subject
Next Message Rod Taylor 2005-11-10 18:27:10 Re: time
Previous Message Rod Taylor 2005-11-10 18:11:27 Re: time