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: Brian Tkatch <SPAMBLOCK.Maxwell_Smart_at_ThePentagon.com.SPAMBLOCK>
Date: Wed, 07 Nov 2001 19:02:07 GMT
Message-ID: <3be98510.75737515@news.alt.net>


On Wed, 07 Nov 2001 18:10:07 GMT, Mark Styles <news_at_lambic.co.uk> wrote:

>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.
>

So

SELECT TO_DATE('01-JAN-1970','DD-MON-YYYY') + 1/11417329.3 FROM DUAL; B. Received on Wed Nov 07 2001 - 13:02:07 CST

Original text of this message

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