I am importing some data from file and every time I get different format of date. So I want to get date format by any function of postgres from database field which is char.
For example,
my_date
-----------
2018-01-30
or
my_date
-----------
30.01.2018
The solution is very simple
to_char(mydate, 'DD-MM-YYYY')
other types of date formats :
'DD/MON/YYYY'
'DD/MON/YY'
'MON/DD/YYYY'
u can switch / with a - or .
postgres - How to get date format from string date