diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a764edfc865f95a1423dc0b76ff97060bf23efd..8ed92b2d53cd62f44700efd70c1bc63e8572a4d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ ### Bugfixes +- Fixed a bug where wrong dates where returned if the database used a different timezone than UTC. - Fixed a bug in `mytoken-migratedb` were empty databases could not be setup. ### Dependencies diff --git a/internal/db/cluster/cluster.go b/internal/db/cluster/cluster.go index dcee805c660b2f822ff73b6901fc04299fada68b..5e8cb04228e3f270f3a66c34cbd1aa261265f9f4 100644 --- a/internal/db/cluster/cluster.go +++ b/internal/db/cluster/cluster.go @@ -154,7 +154,8 @@ func connectDSN(dsn string) (*sqlx.DB, error) { db.SetConnMaxLifetime(time.Minute * 4) db.SetMaxOpenConns(10) db.SetMaxIdleConns(10) - return db, nil + _, err = db.Exec(`SET time_zone="+0:00"`) + return db, err } // Transact does a database transaction for the passed function