Home > database >  How to set DateStyle for Heroku Postgress to DMY?
How to set DateStyle for Heroku Postgress to DMY?

Time:07-01

I am staging a newly build web application on Heroku. As we are in Asia, all our date format is DMY. However Heroku Postgres is in MDY.

After researching, I thought this post Heroku Postgresql SET datestyle To european is the solution.

in heroku pg:psql

ALTER DATABASE database_name SET datestyle TO 'ISO, european';

It does not work. At this point, I am stuck on what else I can do to change date format.

For info, I use database_name from the DATABASE_URL in the

heroku pg:credentials:url

Connection URL:
postgres://user:pasword@host:port/**database_name**

CodePudding user response:

Set datestyle to 'GERMAN, DMY' for that. Also, don't forget that changes made wil ALTER DATABASE only apply to new database sessions.

  • Related