pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Rod Taylor <pg@rbt.ca>
Cc: Judith Altamirano Figueroa <jaltamirano@correolux.com.mx>
Cc: pgsql-sql@postgresql.org
Subject: Re: time
Date: Thu, 10 Nov 2005 11:21:39 -0700
Message-ID: <20051110182139.GA87715@winnie.fuhr.org> (raw)
In-Reply-To: <1131646287.819.144.camel@home>
References: <1131635035.3529.143.camel@Desarrollo>
	<1131646287.819.144.camel@home>

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



view thread (10+ messages)  latest in thread

Message-ID: <20051110182139.GA87715@winnie.fuhr.org>
Permalink:  ../20051110182139.GA87715@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20051110182139.GA87715@winnie.fuhr.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mike@fuhr.org, pg@rbt.ca, jaltamirano@correolux.com.mx
  Subject: Re: time
  In-Reply-To: <20051110182139.GA87715@winnie.fuhr.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox