Reputation: 3264
since few weeks I started working on SQL developer.
I noticed an important issue that I do not know how to solve. This is related to the way my SQL developer visualizes the date.
First of all, here are my settings:
and here is my problem:
select to_date('01-01-0001', 'DD-MM-YYYY') from dual;
select select to_date('01-01-2001', 'DD-MM-YYYY') from dual;
It is interesting to observe that the issue of the day disappear when we change year.
Upvotes: 0
Views: 644
Reputation: 22427
So this -
Example:
If you were querying a date w/o supplying a date format, then it adopts said settings.
But if you query a string, and ask Oracle to treat it as a date
select to_date('1-1-1990', 'DD-MM-YYYY') from dual;
The DD-MM-YYYY tells Oracle how to interpret your string as a date.
And then the output is shown using the format defined for NLS
Now, for your scenario, the year '1' - there is a bug in SQL Developer 18.1 that is causing the date to come back as 3 vs 1.
Bug 28093149 - DATE IS RETURNED INCORRECTLY FOR 01/01/0001 - COMES BACK AS 03/01/0001
Upvotes: 3