Re: Getting time from date field - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Getting time from date field
Date
Msg-id 20031106013453.GB26471@dcc.uchile.cl
Whole thread Raw
In response to Getting time from date field  (Alejandro Javier Pomeraniec <apomeraniec@buenosaires.gov.ar>)
List pgsql-general
On Wed, Nov 05, 2003 at 05:12:12PM +0000, Alejandro Javier Pomeraniec wrote:

> Is there any way to get the time like the following example ?
>
> '2003-05-11 15:21:21'
>
> should return
>
> '15:21:21'

Cast it to time:

regression=# SELECT '2003-05-11 15:21:21'::time;
   time
----------
 15:21:21
(1 fila)

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"No necesitamos banderas
No reconocemos fronteras"                  (Jorge González)

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: tsearch2 and gist index bloat
Next
From: ljb
Date:
Subject: Re: pgtcl patch, lost messages? / was: PostgreSQL v7.4 Release Candidate 1