PostgreSQL : cast string to date DD/MM/YYYY

前端 未结 3 1719
小鲜肉
小鲜肉 2020-12-28 12:19

I\'m trying to cast a CHARACTER VARYING column to a DATE but I need a date format like this : DD/MM/YYYY. I use the following SQ

3条回答
  •  情歌与酒
    2020-12-28 12:42

    https://www.postgresql.org/docs/8.4/functions-formatting.html

    SELECT to_char(date_field, 'DD/MM/YYYY')
    FROM table
    

提交回复
热议问题