Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: time conversion
Shawn Bernard ¼¶¼g©ó¤å³¹ <36CB2110.6A213069_at_mci.com>...
>I am coding in PL/SQL and i need to take a number (ranging from 0 to 23)
>and convert it to the appropriate hour. For example: 4 ==> 4:00 AM (or
>4 AM), 14 ==> 2:00 PM
>
>I can't seem to get the TO_DATE to work. Does anyone have a solution?
select to_char(to_date(1, 'j')+x/24, 'HH:MI AM') from dual;
for example, if x is 4, the statement will return 02:00 PM. Received on Fri Feb 19 1999 - 21:39:05 CST
![]() |
![]() |