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: getting milliseconds from a DATE

Re: getting milliseconds from a DATE

From: Brian Peasland <oracle_dba_at_nospam.peasland.net>
Date: Mon, 8 May 2006 16:05:53 GMT
Message-ID: <IyyFE6.AxB@igsrsparc2.er.usgs.gov>


Robert Klemme wrote:
> ianal Vista wrote:

>> laredotornado_at_zipmail.com wrote in news:1147093983.362115.82810
>> @y43g2000cwc.googlegroups.com:
>>
>>> Hello,
>>>
>>> I'm using Oracle 9i on Solaris.  How do I take a column of a DATE type
>>> and convert it to milliseconds that have elapsed since Jan. 1, 1970, 12
>>> AM?
>>>
>>> Thanks for any help, - Dave
>>>
>>>
>>
>> You do NOT get millisecond from DATE; must use TIMESTAMP

>
> Hey, you could have been more helpful. Why didn't you suggest to
> convert the DATE to TIMESTAMP and then extract ms?
>
> SCNR
>
> robert

Converting a DATE to a TIMESTAMP will not yield any millisecond values other than 0. You cannot obtain more precision out of a value in one datatype by converting it to a different datatype. For instance, you cannot convert an integer value 'X' to a floating point number and get more than 'X.0' out of it.

HTH,
Brian

-- 
===================================================================

Brian Peasland
oracle_dba_at_nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Received on Mon May 08 2006 - 11:05:53 CDT

Original text of this message

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