Uploading a data to the database with which I work, I realized that by default when placing a date type field SQL Developer places it in 'RRRR' format as in the following screenshot:
But the format can be changed in the list to 'YYYY'
So I made a query to know that it returns the format 'RRRR'
select to_date(sysdate, 'dd/mm/rrrr') from dual; /* retorna 17/11/20 */
select to_char(sysdate, 'dd/mm/rrrr') from dual; /* retorna 17/11/2020 */
What that format 'RRRR' returns to me is the same as what the query returns with the format 'YYYY'
select to_date(sysdate, 'dd/mm/yyyy') from dual; /* retorna 17/11/20 */
select to_char(sysdate, 'dd/mm/yyyy') from dual; /* retorna 17/11/2020 */
I would like to know if there is actually any difference between both formats
YYYY
Gives the current year, in 4-digit format.RRRR
means that the 2-digit years in the range from00
to49
are assumed to be in the current century (that is, they have the same first two digits as the current year), and the given years from to are assumed50
to be99
in the previous century.Examples:
Results: