Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Convert number to date in Oracle
Hi,
If I have understood ok your question, for example: the date
01-jan-1970 00:00:45, in your database, it will be stored with the
number: 45, not?
And , another example: the date 03-jan-1970 02:23:34, in your
database, it will be stored with the number: 181414 , not?
Then, if you field is called date_seconds, for example, the select you must do is:
select
to_char( to_date('01-jan-1970 00:00:00','dd-mon-yyyy hh24:mi:ss') +
date_seconds/86400,
'dd-mon-yyyy hh24:mi:ss')
from table
The examples:
select
to_char( to_date('01-jan-1970 00:00:00','dd-mon-yyyy hh24:mi:ss')
+ 45/(86400),'dd-mon-yyyy hh24:mi:ss')
from dual
TO_CHAR(TO_DATE('01-
And the other example:
select
to_char( to_date('01-jan-1970 00:00:00','dd-mon-yyyy hh24:mi:ss')
+ 181414 /(86400),'dd-mon-yyyy hh24:mi:ss')
from dual
TO_CHAR(TO_DATE('01-
I hope it's useful to you, and if it's works fine and you want I
explain you the select, tell me.
Regards,
Isa
Received on Mon Feb 13 2006 - 06:37:22 CST
![]() |
![]() |