Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: time conversion

Re: time conversion

From: fumi <fumi__at_tpts5.seed.net.tw>
Date: 20 Feb 1999 03:39:05 GMT
Message-ID: <7alaop$pto$2@news.seed.net.tw>

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

Original text of this message

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