{"id":27253452,"url":"https://github.com/marselester/pg-time","last_synced_at":"2026-04-30T13:34:34.412Z","repository":{"id":143042071,"uuid":"131721434","full_name":"marselester/pg-time","owner":"marselester","description":"Testing Go time.Time and PostgreSQL Timestamptz","archived":false,"fork":false,"pushed_at":"2018-06-07T04:29:04.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T01:36:42.058Z","etag":null,"topics":["golang","postgresql","timestamp"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marselester.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-05-01T14:17:38.000Z","updated_at":"2019-08-01T05:52:08.000Z","dependencies_parsed_at":"2023-03-21T00:28:54.694Z","dependency_job_id":null,"html_url":"https://github.com/marselester/pg-time","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marselester/pg-time","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marselester%2Fpg-time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marselester%2Fpg-time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marselester%2Fpg-time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marselester%2Fpg-time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marselester","download_url":"https://codeload.github.com/marselester/pg-time/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marselester%2Fpg-time/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32466333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","postgresql","timestamp"],"created_at":"2025-04-11T01:27:39.933Z","updated_at":"2026-04-30T13:34:34.407Z","avatar_url":"https://github.com/marselester.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostgreSQL Timestamptz and Go Idiosyncrasies\n\n[Time is hard topic](https://zachholman.com/talk/utc-is-enough-for-everyone-right) ⏳\n\nPostgreSQL converts time from the connection's time zone to UTC on storage,\nand from UTC to the connection's time zone on retrieval.\nHowever I was surprised to find that [pgx PostgreSQL driver](https://github.com/jackc/pgx)\ndoesn't return `time.Time` in UTC format despite configuring connection with\n\n- `postgres://account:swordfish@localhost/account?timezone=UTC`\n- `SET TIME ZONE 'UTC'`\n- `SET timezone TO 'UTC'`\n\nFor example, `2009-11-10 23:00:00 +0000 UTC` is retrieved from db as `2009-11-11 06:00:00 +0700 +07`.\nThough the dates are equal, the UTC format is what I expected.\n\nI compared the behavior with [pq PostgreSQL driver](https://github.com/lib/pq/) and it returns UTC date.\n\n```sh\n$ make docker_run_postgres\n$ go test ./...\n```\n\nAnother caveat is `time.Time` nanosecond resolution and timestamptz microsecond resolution.\nThe current solution is to use [Truncate](https://github.com/lib/pq/issues/227).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarselester%2Fpg-time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarselester%2Fpg-time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarselester%2Fpg-time/lists"}