How do I alter the date format in Postgres?

后端 未结 3 1607
慢半拍i
慢半拍i 2020-12-01 04:29

I\'m getting the following error message

ERROR: date/time field value out of range: \"13/01/2010\" HINT: Perhaps you need a different \"datestyle\" setting.

<
3条回答
  •  独厮守ぢ
    2020-12-01 05:11

    You could set the date style to Europian (dd/mm/yyyy):

    SET DateStyle TO European;
    

    I'd advise against this though. I generally try to convert between formats, and keep ISO formatted dates in the data source. After all, it's only a matter of representation, not a matter of different data.

提交回复
热议问题