Re: DATE/time - adding minutes

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Wed, 27 Oct 1999 14:00:18 -0400
Message-ID: <hDwXOEWaXQds7QSY=V0PjuShybDH_at_4ax.com>


A copy of this was sent to "keso" <keso_at_hep.tel.fer.hr> (if that email address didn't require changing) On Wed, 27 Oct 1999 18:20:01 +0200, you wrote:

>
>What is the simplest method of calculating DATE that is e.g. 15 minutes
>after specified DATE/time?
>
>Is it really necessary to write function similar to ADD_MONTHS:
>
>FUNCTION ADD_MINUTES (d DATE, mi number) return DATE is /* d = d + mi */
>...
>
>thanks,
>
>Vedran
>
>

sysdate + 1/24/60*15

if you add 1 -- you add a day.

if you add 1/24 -- you add 1 hour.
if you add 1/24/60 -- you add 1 minute.
if you add 1/24/60/60 -- you add 1 second.

see http://osi.oracle.com/~tkyte/Misc/DateDiff.html for more info.

-- 
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
 
Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Wed Oct 27 1999 - 20:00:18 CEST

Original text of this message