var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Convert int to time
I'm new to db and I have a problem. I have integer, like 100, 118 and I have to convert this to time, like 118 -> 1:58. The reason is I have a column date (format date) and I have to add the integer to the date, so I need to change the format of my int to time (I think).
thanks for help.
You'll need to write a little conversion routine ...
ie, type this in sqlplus ...
select to_char((trunc(sysdate)+(118/1440)),'dd-mon-yy hh24:mi:ss') from dual;
Change the value of 118 to your INT values ...
Oracle allows for arithmatic operations on Dates.
So if you want to add 1 day to a date
date_column + int_column
if your interger represents hours divide your int by 24
date_column + (int_column / 24)
date_column + (int_column / 24/60)
date_column + (int_column / 24/60/60)
in your case it appears your INT is minutes, so use
date_column + (int_column /24/60)
btw, in the previous example they use the TRUNC function. Only do this, if you want to reset the hours and minutes of your date_column
thanks for help
Last edited by koolyce; 02-14-05 at