Results 1 to 4 of 4
  1. #1
    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

  2. #2
    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! "

  3. #3
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    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

  4. #4
    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 ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •