RE: seconds from midnight into a date field?

  • From: Mark Moynahan <Mark.Moynahan@xxxxxxxxxxxxx>
  • To: "'oracle-l@xxxxxxxxxxxxx'" <oracle-l@xxxxxxxxxxxxx>
  • Date: Mon, 12 Jul 2004 10:11:07 -0700

If you're running on 9i you can do something like this:

alter session set nls_date_format='dd-mon-yyyy hh24:mi:ss';

markis@PRACTICE>select numtodsinterval(0001,'SECOND')+trunc(sysdate)dt from
dual;

DT
--------------------
12-jul-2004 00:00:01


markis@PRACTICE>select numtodsinterval('0050','SECOND')+trunc(sysdate)dt
from dual;

DT
--------------------
12-jul-2004 00:00:50

markis@PRACTICE>select numtodsinterval('0054','SECOND')+trunc(sysdate)dt
from dual;

DT
--------------------
12-jul-2004 00:00:54


HTH,

Mark

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
To: oracle-l@xxxxxxxxxxxxx
Sent: 7/12/2004 5:54 AM
Subject: seconds from midnight into a date field?

I have a varchar field that I need to migrate to a date field. it is in
the form 'seconds from midnight' and looks like this
0001
0050
1054
I can't find a to_date function to translate that. do any exist? 

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: