How to change datestyle in PostgreSQL?

后端 未结 4 398
春和景丽
春和景丽 2020-12-14 17:00

In postgres I have a table with date column. Now postgres allows me to write date in Y-m-d format. But I need date in d/m/Y format. How to change it?

When I do:

4条回答
  •  囚心锁ツ
    2020-12-14 17:39

    Use the to_char function with your date as follows:

    select to_char(date_column1, 'Mon/DD/YYYY');
    

提交回复
热议问题