Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Date Conversion
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C01361.0145E64C
Content-Type: text/plain;
charset="iso-8859-1"
If you are sure they are microseconds ... this might will help you ..... following query yields ... "08-22-2000 18:57:40" as output.
SELECT TO_CHAR(TO_DATE('01011970','mmddyyyy') + (966970660171/86400000), 'MM-DD-YYYY HH24:MI:SS') FROM dual;
Raj
------_=_NextPart_001_01C01361.0145E64C
Content-Type: text/html;
charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Date Conversion</TITLE>
<META content="MSHTML 5.00.2919.6307" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT color=#0000f0>
<P><FONT color=#000080 size=2><SPAN class=415273315-31082000>If you are sure
they are microseconds ... this might will help you ..... following query yields
... "08-22-2000 18:57:40" as output.</SPAN></FONT></P><FONT size=2>
<P>SELECT</FONT><FONT color=#000000> TO_CHAR</FONT><FONT
color=#0000f0>(</FONT><FONT color=#000000>TO_DATE</FONT><FONT color=#0000f0>(</FONT><FONT color=#ff0000>'01011970'</FONT><FONT color=#0000f0>,</FONT><FONT color=#ff0000>'mmddyyyy'</FONT><FONT color=#0000f0>)</FONT><FONT color=#000000> </FONT><FONT color=#0000f0>+</FONT><FONT color=#000000> </FONT><FONT color=#0000f0>(</FONT><FONT color=#800000>966970660171</FONT><FONT color=#0000f0>/</FONT><FONT color=#800000>86400000</FONT><FONT color=#0000f0>),</FONT><FONT color=#000000> </FONT><FONT color=#ff0000>'MM-DD-YYYY HH24:MI:SS'</FONT><FONT color=#0000f0>)<SPAN class=415273315-31082000> </SPAN>FROM</FONT> dual<SPAN class=415273315-31082000>;</SPAN></P>