0

Problem in date_to_str with a pattern with miliseconds

I want to make the cast from str to date with a 6 milliseconds precision. The problem is that sometimes it rounds it to 3 milliseconds. It seems that the problem is when the fourth millisecond is 5 or bigger, is there any way that it doesn't do that? I need always 6 milliseconds.

SQL> select DATE_FROM_STR('09-06-2017 10:01:36.111499', 'MM-dd-YYYY HH:mm:ss.SSSSSS') from dual;

date_from_str
--------------------------

2016-12-26 10:01:36.111499

SQL> select DATE_FROM_STR('09-06-2017 10:01:36.111599', 'MM-dd-YYYY HH:mm:ss.SSSSSS') from dual;

date_from_str
-----------------------

2016-12-26 10:01:36.112

Thanks a lot,

1 comment

Please sign in to leave a comment.