Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8006161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:25:20+00:00 2026-06-04T17:25:20+00:00

How does Oracle DB round milliseconds in its date function? For example if sysdate

  • 0

How does Oracle DB round milliseconds in its date function?

For example if sysdate is run at exactly “05/25/2012 01:15:25.900”, would the date be stored as “05/25/2012 01:15:26” (rounding up) or as “05/25/2012 01:15:25” (rounding down)?

Does it round up for everything beyond half a millisecond, and down for everything lower than half a millisecond?

Here is a simple test I put together:

SELECT to_char(systimestamp, 'dd-mm-yyyy hh:mi:ss:ff') as sys_time_stamp,
to_char(
     TO_DATE (
         TO_CHAR (SYSTIMESTAMP, 'YYYY-MON-DD HH24:MI:SS'),
         'YYYY-MON-DD HH24:MI:SS'), 
     'dd-mm-yyy hh:mi:ss') as sys_date
FROM DUAL;

Run 1
sys_time_stamp: 25-05-2012 12:37:32:798000
sys_date: 25-05-012 12:37:32

Run 2
sys_time_stamp: 25-05-2012 12:43:41:322000
sys_date: 25-05-012 12:43:41

This would indicate that at least when converting a systimestamp to a date the milliseconds are just dropped. But when sysdate is actually generated, are milliseconds actually just dropped?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T17:25:21+00:00Added an answer on June 4, 2026 at 5:25 pm

    Rounding the fractions of time up would result in the sysdate being on average half a second fast.

    It would flip to the next day at 23:59:59.500.

    This would obviously be idiotic, so I’m going to go with truncation rather than rounding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does Oracle have its own implementation of SQL Server stuff function? Stuff allows you
Does Oracle have a column metadata for storing its printable friendly label? Say I
In Oracle (10g), when I use a View (not Materialized View), does Oracle take
Oracle does not support a bit datatype or any other type for true/false scenarios.
Does LINQPad work with Oracle? Has anyone tried? What do you suggest?
On Oracle 9i, why does the following produce the result 'abc' select 'abc '
Using an Oracle temporary table does not generate much redo log as a normal
In Oracle, this returns 03/01/2010. That does not make sense to me. Anybody know
Does anyone know where i can find such a AMI? Oracle database Enterprise Edition
When Oracle is estimating the 'Cost' for certain queries, does it actually look at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.