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: correct to_date function question

Re: correct to_date function question

From: Mark Styles <news_at_lambic.co.uk>
Date: Wed, 07 Nov 2001 18:10:07 GMT
Message-ID: <20uiut45meopign3b0oqoa5dhkmkjsb2nr@4ax.com>


On Wed, 7 Nov 2001 12:05:53 -0600, "SG" <sajnish_gupta_at_yahoo.com> wrote:

>Thanks for your replies, but sorry, I messed up my earlier question. I am
>trying to convert the UNIX date (in seconds since 1970) to date:
>
>SQL> select to_date((to_date('01-JAN-1970','DD-MON-YYYY') + 11417329.3))
>from dual;

should be:

SELECT TO_DATE('01-JAN-1970','DD-MON-YYYY') + 11417329.3 FROM DUAL; Adding a number to a date returns a date by default.

However, this is adding 11 million days to your date, which is rather a lot. There have only been around 11000 days since 1970. Received on Wed Nov 07 2001 - 12:10:07 CST

Original text of this message

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