Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Time Operations

Re: Time Operations

From: QuestionExchange <USENET_at_questionexchange.com>
Date: 2000/01/07
Message-ID: <2282qx@questionexchange.com>#1/1

> Hello
>
> I'm trying to do some time calculations like:
>
> select to_date('03:15:00', 'hh:mi:ss') - to_date('03:00:00',
 'hh:mi:ss')
> test
> from dual;
>
> TEST
> ---------
> .01041667
>
> The problem is to set 'TEST' back to a time (resp. date)
 format.
> Any suggestions?
>
> Thanks
> Dan
>
>
>
>
>
>

The difference is given in terms of days. Basically the difference is 0.01041667 days. multiply the result by 24*60 to get the difference always in minutes.
select to_number(to_date('01-01-1900 03:15:00','dd-mm-yyyy hh:mi:ss') - to_date('01-01-1900 03:00:00','dd-mm-yyyy hh:mi:ss') ) *24 * 60 X from dual;

    X


    15
regards
venkat

-- 
  This answer is courtesy of QuestionExchange.com
  http://www.questionexchange.com/showUsenetGuest.jhtml?ans_id=9612&cus_id=USENET&qtn_id=11532
Received on Fri Jan 07 2000 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US