Re: [CHALLANGE] Add seconds to a date

From: panjas51 <panjas51_at_yahoo.fr>
Date: 26 Feb 2002 01:31:11 -0800
Message-ID: <3c1b889f.0202260131.137e678b_at_posting.google.com>


Instead of sysdate I do have a fix date which is 01-jan-1980.

It works well, but If I want to add select 632952000, I am suppose to get back this date: 21/01/00 20:00:00

to_char(to_date('01-01-1980','DD-MM-YY'),'DD-MM-YY HH:MI:SS'), to_char(to_date('01-01-1980','DD-MM-YY')+632952000/(24*60*60),'DD-MM-YY HH24:MI:SS') from dual;

[Quoted] I don't know way you divide by (24*60*60), but anyway it seems working.

"Yann CAUCHARD" <yann.cauchard_at_spcconsultants.com> wrote in message news:<a5dph2$2nm6$1_at_news6.isdnet.net>...
> try somrthing like :
>
> select to_char(sysdate,'MI:SS'), to_char(sysdate+100/(24*60*60),'MI:SS')
> from dual;
>
> hth.
>
> Yann
>
> panjas51 a écrit dans le message
> <3c1b889f.0202250828.772510aa_at_posting.google.com>...
> >I tried to make a PLSQL (oracle) function in order to add some seconds
> >to a specified date:
> >
> >Let's take a exemple:
> >New_date=sec2date(#2002-02-02#, 100),
> >this should add 100 seconds to the entered date:
> >this should then return "2002-02-02 00:01:40".
> >
> >Attention to the lead year.
> >
> >If any one wants to take this challage or propose some quick wins
> >idees
Received on Tue Feb 26 2002 - 10:31:11 CET

Original text of this message