Re: Ayuda manejo de horas

From: "Ing(dot) Jhon Carrillo" <jdigital(at)cantv(dot)net>
To: "Daniel Alvarado" <danielal2(at)yahoo(dot)com>
Cc: <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: Ayuda manejo de horas
Date: 2005-05-23 21:07:24
Message-ID: 03b801c55fdb$6b441e30$1400a8c0@tgusta2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Hi dear friend:

prueba con esto:

select (to_number(to_char(to_timestamp('01:01:01','HH:MI:SS'),'HH'),'99') *
3600) +

(to_number(to_char(to_timestamp('01:01:01','HH:MI:SS'),'MI'),'99') * 60) +
(
to_number(to_char(to_timestamp('01:01:01','HH:MI:SS'),'SS'),'99')) as
algo_en_segundos

Jhon Carrillo
Ingeniero en Computación
jdigital+(at)+cantv+(dot)+net (quitar +)
+584145246033
Caracas - Venezuela

> Que tal.
> Esto solo me regresa la parte 'SS'.
> select to_char(to_timestamp(duracion,'HH:MI:SS'),'SS')
> from tabla1;
>
> Lo que en realidad necesito es el numero total de
> segundos. Por ejemplo en '01:01:01' son 3661 segundos.
> Eso es lo que necesito obtener.
>
> Saludos Jhon, y gracias.
>
>
> --- "Ing. Jhon Carrillo" <jdigital(at)cantv(dot)net> wrote:
> > Saludos,
> >
> > Prueba con esto:
> >
> > select
> > to_char(to_timestamp(duracion,'HH:MI:SS'),'SS');
> >
> > espero te sirva
> >
> > Suerte!!!
> >
> > Jhon Carrillo
> > Ingeniero en Computación
> > jdigital+(at)+cantv+(dot)+net (quitar +)
> > +584145246033
> > Caracas - Venezuela
> >
> >
> >
> >
> > Select to_char(duracion,'HH:MI:SS')
> > ----- Original Message -----
> > From: "Daniel Alvarado" <danielal2(at)yahoo(dot)com>
> > To: <pgsql-es-ayuda(at)postgresql(dot)org>
> > Sent: Monday, May 23, 2005 1:00 PM
> > Subject: [pgsql-es-ayuda] Ayuda manejo de horas
> >
> >
> > > Que tal Lista.
> > > Tengo una tabla con un campo (duracion varchar(8))
> > en
> > > el cual tengo valores de horas en formato
> > HH:MI:SS,
> > > por ejemplo '01:01:01'.
> > > Necesito obtener el numero de segundos, en este
> > caso
> > > 3661 segundos.
> > > Esto es lo que estoy haciendo pero no funciona.
> > > select extract(EPOCH from time duracion)
> > > from tabla1
> > > Este es el error que obtengo:
> > > parse error at or near "duracion" at character 32.
> > > Que debo hacer???
> > >
> > >
> > >
> > > Discover Yahoo!
> > > Use Yahoo! to plan a weekend, have fun online and
> > more. Check it out!
> > > http://discover.yahoo.com/
> > >
> > > ---------------------------(fin del
> > mensaje)---------------------------
> > > TIP 10: visita nuestro canal de IRC #postgresql-es
> > en irc.freenode.net
> > >
> >
> >
> >
>
>
>
> __________________________________
> Yahoo! Mail Mobile
> Take Yahoo! Mail with you! Check email on your mobile phone.
> http://mobile.yahoo.com/learn/mail
>

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message mmiranda 2005-05-23 21:10:39 RE: Ayuda manejo de horas
Previous Message Daniel Alvarado 2005-05-23 20:51:40 Re: Ayuda manejo de horas