Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgreSQL does not return expected timezone #7377

Open
keif888 opened this issue Mar 1, 2025 · 0 comments
Open

PostgreSQL does not return expected timezone #7377

keif888 opened this issue Mar 1, 2025 · 0 comments
Assignees
Labels
type:with reproduction steps with reproduction steps

Comments

@keif888
Copy link

keif888 commented Mar 1, 2025

GORM Playground Link

go-gorm/playground#790

Description

With the database server configured for UTC as it's timezone, and the connection string configured as UTC as it's timezone, the retrieval of a GO time should have the time.Location set to UTC.

This works for mysql, sqlite.
It does not work for postgres.

There is a fix for this issue in pgx, but I can't see how to use it in gorm.
See the following two issues for discussions on the underlying cause of the issue.

jackc/pgx#1945
jackc/pgx#2117 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:with reproduction steps with reproduction steps
Projects
None yet
Development

No branches or pull requests

2 participants