Convert data to dd / MM / yyyy ORACLE

2
How to format sysdate for dd / MM / yyyy in Oracle 11g?

    
asked by anonymous 21.08.2015 / 03:07

2 answers

6

Try this:

SELECT TO_DATE(TO_CHAR(sysdate, 'DD/MM/YYYY'), 'DD/MM/YYYY') AS data_formatada FROM tabela
    
21.08.2015 / 03:09
2

We can use the RRRR year format, which does century recognition to convert the year being required only 2 digits, for example 50 as we have not yet arrived in 2050 will be converted to the year 1950, but if it is filled with 10 it will be returned 2010, by example.

 SELECT TO_DATE('01/01/50','DD/MM/RRRR'), 
        TO_DATE('01/01/10','DD/MM/RRRR'), 
        TO_DATE('01/01/50','DD/MM/YYYY') 
   FROM DUAL
    
27.01.2016 / 15:16