Skip to content

Commit

Permalink
FIX #3372 - Printing issue with Postgres and dates (SQL format)
Browse files Browse the repository at this point in the history
After connecting to the database, we force datestyle to "ISO, YMD", so dates returned by the db will have a format compatible with Dolibarr functions.
This will fix dates printing issues in mostly all pages, with a postgres db configured with "SQL, DMY" as default.
  • Loading branch information
tomours committed Aug 10, 2015
1 parent ef5d394 commit 9267fe3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions htdocs/core/db/pgsql.class.php
Expand Up @@ -410,6 +410,7 @@ function connect($host, $login, $passwd, $name, $port=0)
$this->database_name = $name;
pg_set_error_verbosity($this->db, PGSQL_ERRORS_VERBOSE); // Set verbosity to max
}
pg_query($this->db, "set datestyle = 'ISO, YMD';");

return $this->db;
}
Expand Down

0 comments on commit 9267fe3

Please sign in to comment.