How to format number to a time [message #237626] |
Tue, 15 May 2007 04:36 |
manoj_vilayil
Messages: 9 Registered: May 2007 Location: India
|
Junior Member |
|
|
Sir,
Suppose in the back end there is a field called called start time in number format.How can i convert it to HH:MI format
Eg: Start Time = 8.3
I want the output in 08:30
Start Time = 1.05
I want output in 01:05
|
|
|
|
|
|
Re: How to format number to a time [message #237638 is a reply to message #237633] |
Tue, 15 May 2007 05:15 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
SQL> with data as (select 8.3 t from dual)
2 select replace(to_char(data.t, 'fm00.00'), '.', ':') from data;
REPLAC
------
08:30
This has nothing to do with times or dates or whatever. You just want to fill out with zeros and use a colon instead of a dot.
[Edit: added fm to format-mask]
[Updated on: Tue, 15 May 2007 05:16] Report message to a moderator
|
|
|
|
|