Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Date and Time arithmetic
> Hi,
>
> is there any way in oracle to get the number of seconds, minutes, and hours
> between 2 date columns, e.g 11.03.2003 10:00:00 and 09.03.2003 08:15:20?
Something like that?
alter session set nls_date_format = 'dd.mm.yyyy hh24:mi:ss';
select
trunc(to_date('11.03.2003 10:00:00') -
to_date('09.03.2003 08:15:20')) "Days",
to_char(to_date('01.01.0001 00:00:00') +
(to_date('11.03.2003 10:00:00') -
to_date('09.03.2003 08:15:20')),' hh24 mi ss') "Hrs Min Sec"
from
dual;
hth
Rene Nyffenegger
-- Projektleitung und Entwicklung in Oracle/C++/C# Projekten http://www.adp-gmbh.ch/cv.htmlReceived on Wed Mar 12 2003 - 04:59:01 CST