Re: Getting time from date field

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Alejandro Javier Pomeraniec <apomeraniec(at)buenosaires(dot)gov(dot)ar>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Getting time from date field
Date: 2003-11-06 01:34:53
Message-ID: 20031106013453.GB26471@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message ljb 2003-11-06 01:40:02 Re: pgtcl patch, lost messages? / was: PostgreSQL v7.4 Release Candidate 1
Previous Message Joshua D. Drake 2003-11-06 01:18:47 Re: tsearch2 and gist index bloat