Is there a way to get just the number of seconds between two timestamps?

Поиск
Список
Период
Сортировка
Искать

Is there a way to get just the number of seconds between two timestamps?

От:
A B <gentosaker@gmail.com>
Дата:
I want to just get the number of seconds and not have to use extract
for seconds, minutes, hours, days, months, years, etc.
Is that possible?

Re: Is there a way to get just the number of seconds between two timestamps?

От:
Steve Crawford <scrawford@pinpointresearch.com>
Дата:
A B wrote:
> I want to just get the number of seconds and not have to use extract
> for seconds, minutes, hours, days, months, years, etc.
> Is that possible?
>
>   
extract(epoch from your_end_time) - extract(epoch from your_start_time)

Cheers,
Steve

Re: Is there a way to get just the number of seconds between two timestamps?

От:
Michael Lush <mjlush@ebi.ac.uk>
Дата:


On Wed, 8 Apr 2009, A B wrote:
> I want to just get the number of seconds and not have to use extract
> for seconds, minutes, hours, days, months, years, etc.
> Is that possible?

I suppose you could write your own procedure and get a nice new round 
thing (if your lucky,  you could reinvent the square wheel:-)

What is wrong with EXTRACT?

--
Michael
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Michael John Lush PhD			Tel:44-1223 492626
Bioinformatician 
HUGO Gene Nomenclature Committee	Email: hgnc@genenames.org
European Bioinformatics Institute
Hinxton, Cambridge
URL: http://www.genenames.org
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: Is there a way to get just the number of seconds between two timestamps?

От:
A B <gentosaker@gmail.com>
Дата:
> What is wrong with EXTRACT?

Nothing, now that I found out about the "epoch" option. I must haev missed that.
I just feared  to have to do extracct for each time unit...
Problem solved with extract epoch. :-)
FAQ