| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
|  |  | |||
Home -> Community -> Usenet -> c.d.o.misc -> Re: Converting between Ingres and Oracle: Calculations with dates.
When you subtract two dates in Oracle, you get the difference in days. 
The result will have a decimal part, so if you want to get the number
of seconds between two date/time stamps, you can code:
sec_diff := (time_out - time_in) * 24 * 60 * 60 This works because there are 24 hours in a day, 60 minutes in an hour, and 60 seconds in a minute. You can do similar things to get differences in days, hours, or minutes.
Hope that helps!
Technical wrote:
> 
> Dear All.
> 
> Tanks for those who replied to my last message regarding Ingres Oracle
> converting.  I have another problem.
> 
> Under Ingres when using dates you can perform normal calculations on dates
> as normal e.g.
> 
> Time_diff = (Time_out - Time_In) (All of these are of type date).
> 
> My question is simply this: How can this be done under Oracle.
> 
> Tanks in advance.
> 
> Lloyd Graney.
-- Received on Thu Jan 20 2000 - 09:48:03 CST
|  |  |