If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > finding milli second in oracle

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Feb 2004
Posts: 37
finding milli second in oracle

I am trying to find the milli second in for a given date.

ExELECT TO_CHAR(SYSDATE, 'mm/dd/yyyy:hh24:mi:ss') FROM dual

the above query ouputs upto the seconds, but I need to find the milli seconds for a given time
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Jan 2004
Location: Scottsdale, AZ
Posts: 106
http://download-west.oracle.com/docs...elem.htm#34926

SELECT TO_CHAR(SYSDATE, 'mm/dd/yyyy:hh24:mi:sssss') from dual;

14:44:54 SQL> /

TO_CHAR(SYSDATE,'MM/DD
----------------------
03/09/2004:14:44:53097
__________________
"Take Control!
Make The Choice!
Accept The Consequences!
Deal With The Results! "
Reply With Quote
  #3 (permalink)  
Old
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Quote:
Originally posted by dbtoo2001
http://download-west.oracle.com/docs...elem.htm#34926

SELECT TO_CHAR(SYSDATE, 'mm/dd/yyyy:hh24:mi:sssss') from dual;

14:44:54 SQL> /

TO_CHAR(SYSDATE,'MM/DD
----------------------
03/09/2004:14:44:53097
No, that isn't showng milliseconds: it shows the current time twice:
1) 14:44 in HH24:MI format
2) 53097 seconds since midnight

The fact is, Oracle DATE values don't go below seconds. You need to use the TIMESTAMP datatype for fractional seconds, which are displayed using using a format mask like HH24:MIS.FFF
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: Jul 2003
Posts: 2,296
people, please do searches on this forum.
it will save you time.

all you would have to do is search under "milliseconds"
__________________
- The_Duck
you can lead someone to something but they will never learn anything ...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On