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

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to add seconds to a DATE ?

Re: How to add seconds to a DATE ?

From: Ed Bradt <ebradt_at_lilly.com>
Date: 1998/01/15
Message-ID: <34BE5E68.1BF9@lilly.com>#1/1

Penalva Jean-Christophe wrote:
>
> Hello,
>
> i have a colum of DATE type. I'd like to add to this column a value in
> seconds for example.
>
> I know it's a so silly question, but perhaps i'm silly ??!! :-)
>
> PLEASE HELP ME.
>
> mailto:jean-christophe.penalva_at_cnusc.fr

If you want to add n seconds to a date field then

    newdate = olddate + n/(24*60*60)

to add n minutes    

   newdate = olddate + n/(24*60)

to add n hours

   newdate = olddate + n/24

and you've probably figured it out by now but to add n days

   newdate = olddate + n

Cheers,
Ed

Ed Received on Thu Jan 15 1998 - 00:00:00 CST

Original text of this message

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