pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hector Villarreal <HVillarreal@mynewplace.com>
To: Joe <dev@freedomcircle.net>
To: Judith <jaltamirano@correolux.com.mx>
Cc: pgsql-sql@postgresql.org
Subject: Re: Question about time
Date: Thu, 16 Nov 2006 15:19:17 -0800
Message-ID: <8C5B026B51B6854CBE88121DBF097A865D4530@ehost010-33.exch010.intermedia.net> (raw)
In-Reply-To: <1163715824.692.1.camel@pampa>

Try this one: 

SELECT date_trunc('seconds',now())::time;
"15:11:42"

So it should be select date_trunc('seconds', fecha_hora_factura)::time
from nota_venta;

-----Original Message-----
From: pgsql-sql-owner@postgresql.org
[mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Joe
Sent: Thursday, November 16, 2006 2:24 PM
To: Judith
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Question about time

On Thu, 2006-11-16 at 10:14 -0600, Judith wrote:
>     Hi everyone I'm doing a query like this:
> 
>     SELECT CAST(fecha_hora_factura as time) FROM nota_venta
> 
>     and I get:
> 
>     14:16:52.824395
> 
>     the field is timestamp type....... I just want the
HOUR:MINUTE:SECOND
> 
>     the question is how I drop the millisecond??

Take a look at date_trunc() under Date/Time Functions and Operators.

Joe


---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

                http://www.postgresql.org/about/donate



view thread (4+ messages)

Message-ID: <8C5B026B51B6854CBE88121DBF097A865D4530@ehost010-33.exch010.intermedia.net>
Permalink:  ../8C5B026B51B6854CBE88121DBF097A865D4530@ehost010-33.exch010.intermedia.net/
Also on:    postgresql.org/message-id/8C5B026B51B6854CBE88121DBF097A865D4530@ehost010-33.exch010.intermedia.net

 · 

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: HVillarreal@mynewplace.com, dev@freedomcircle.net, jaltamirano@correolux.com.mx
  Subject: Re: Question about time
  In-Reply-To: <8C5B026B51B6854CBE88121DBF097A865D4530@ehost010-33.exch010.intermedia.net>

* 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