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

Home -> Community -> Usenet -> c.d.o.server -> Re: Is there a dateadd() function?

Re: Is there a dateadd() function?

From: Jeremy Ovenden <jovenden_at_hazelweb.co.uk>
Date: Tue, 21 Jul 1998 20:15:42 +0100
Message-ID: <35B4E8DE.6978CF82@hazelweb.co.uk>


Good stuff....can I extend the question any further? What is the simplest means of obtaining the number of seconds between two dates (i.e. including the time component)?As far as I can tell, there isn't an Oracle function for returning such a value given two dates?

nasof_at_hotmail.com wrote:

> To add 3 hours to the current time:
> select to_char(sysdate, 'dd/mm/yy hh24:mi:ss') from dual;
>
> TO_CHAR(SYSDATE,'
> -----------------
> 07/21/98 14:49:06
>
> select to_char(sysdate+(1/24)*3, 'mm/dd/yy hh24:mi:ss') from dual;
>
> TO_CHAR(SYSDATE+(
> -----------------
> 07/21/98 17:49:07
>
> Substitute sysdate for the column you desire or to hardcode a date substitute
> sysdate with "to_date('07/21/98 14:49:06', 'mm/dd/yy hh24:mi:ss')"
>
> -Frank
>
> In article <35B4AA9B.BB726DFB_at_cgi.ca>,
> Daniel Kosolofski <daniel.kosolofski_at_cgi.ca> wrote:
> > I am used to using SQl Server and not
> > Oracle so I am not totaly familiar with
> > the systax.
> >
> > So on that note my question is how do
> > you add/subtract dates (specifically
> > hours) .
> > E.g. ('02/jun/1998 12:00 A.M' - 3 hours)
> > I know in SQL Server there is a dateadd
> > function.
> > Is there the same thing in oracle.
> >
> > I am currently on holidays and have no
> > access to books so please send syntax or
> > example. PLEASE!!
> >
> > Thank You all for the help in advance!
> >
> > --
> > Daniel Kosolofski
> > Consultant
> > CGI Information Systems and Management
> > Consultants Inc.
> > 333 Seventh Avenue S.W.
> > Calgary, Alberta
> > Canada T2P 2Z1
> > Voice: (403) 233-2713
> > Fax: (403) 262-8236
> > Email: daniel.kosolofski_at_cgi.ca
> >
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
Received on Tue Jul 21 1998 - 14:15:42 CDT

Original text of this message

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