Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: command to display time in DATE format
Jim Kennedy wrote:
> <mehaboob_at_gmail.com> wrote in message
> news:1149603061.349299.173000_at_c74g2000cwc.googlegroups.com...
> > Hi,
> >
> > In oracle DB table,I have a varchar field which stores time in EPOCH
> > fomat
> > for eg:11652232 secs
> >
> > Is there a command to display the above time in Date format? (something
> > like DD MM YY)
> >
> > Mehaboob
> >
>
> Why store numbers in character fields? Store numbers in number fields.
> (myfield/(24*60*60))+to_date('01/01/1970','mm/dd/yyyy'),
> Jim
Mehaboob, to display a date in any character representation always use to_char. So jjust put a to_char around Jim's calculation: to_char( column / (24 * 60 * 60) + to_date('01-01-1970','mm-dd-yyyy'),' DD MM YY')
HTH -- Mark D Powell -- Received on Tue Jun 06 2006 - 11:16:22 CDT