Re: Adding HOURS to DATE

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: Mon, 17 Apr 2000 17:50:27 GMT
Message-ID: <8dfiss$597$1_at_nnrp1.deja.com>


In article <N8GK4.26163$hh2.806093_at_news.flash.net>,   "Joel Finkel" <finkel_at_sdi.com> wrote:
> Folks,
>
> I'd like to know if there is a canonical method to add a specified
number of
> hours to a value in a DATE field. I am aware that the function
NEW_TIME can
> be used to easily convert among some time zones, but not that many.
I need
> a function to add (or subtract) 10 hours, 8 hours, etc. to a given
DATE.
>
> Thanks in advance for all suggestions.
>
> /Joel (finkel_at_sdi.com)
>
>

to add a day:

select sysdate + 1 from dual;

to add an hour:

select sysdate + 1/24 from dual;

to add a minute:

select sysdate + 1/24/60 from dual;

and to add a second:

select sysdate + 1/24/60/60 from dual;

To get differences between dates and for more info, see http://osi.oracle.com/~tkyte/Misc/DateDiff.html

--
[Quoted] Thomas Kyte                              tkyte_at_us.oracle.com
Oracle Service Industries
http://osi.oracle.com/~tkyte/index.html
--
Opinions are mine and do not necessarily reflect those of Oracle Corp


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Apr 17 2000 - 19:50:27 CEST

Original text of this message