Date field display

1

I have a date in the American yyyy-mm-dd format and I would like to put it in the Brazilian dd-mm-yyyy format however I do not want to do as to_char conversion. I need it to continue with the date format because I will need to make filters with date range and how string the filter does not work. Poir that the need to change the position of the date, but remaining the date type.

POSTGRES BANK

    
asked by anonymous 16.01.2018 / 20:16

1 answer

0

You can set an environment variable called DATESTYLE for the < a href="https://www.postgresql.org/docs/current/static/datatype-datetime.html#DATATYPE-DATETIME-OUTPUT-TABLE"> GERMAN :

SET DATESTYLE = 'GERMAN';

Testing:

SELECT current_date;

Output:

    
19.01.2018 / 20:39