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: Adding to Time in Date fields

Re: Adding to Time in Date fields

From: Menons <menonm_at_msn.com>
Date: 1996/12/12
Message-ID: <01bbe8a0$738c3340$db542499@default>#1/1

You could simply add the minutes to the DATE item. For example, if you were to add 20 minutes to December 2 1996 12:50 AM, you would

DECLARE
   l_date DATE := TO_DATE('12/02/1996 00:50', 'MM/DD/YYYY HH24:MI'); BEGIN
   l_date := l_date + 20/1440; /* There are 60*24 = 1440 minutes in a day */
END; HTH, Manohar G Menon
> Marc <marc_at_popmail.med.nyu.edu> wrote in article
> <32A440DF.3F1_at_popmail.med.nyu.edu>...
> > I would like to add a certain number of minutes to
> > a time value stored in an Oracle Date field.
> >
> > Is there an Oracle function to allow me to add the minutes
> > to the field so that the other members of the Date field "day, hour,
> > minutes" will reflect the change?
> >
> > So if I were to add 20 minutes to "December 2, 1996 12:50AM"
> > the resulting Oracle field would be "December 3, 1996 1:10AM"
> >
> > Thanks,
> > Marc Waldman
> > marc_at_popmail.med.nyu.edu
> >
>
Received on Thu Dec 12 1996 - 00:00:00 CST

Original text of this message

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