Golang postgres timestamp issue

I have an application that runs in multiple timezones and I am saving data in Postgres database. Each row that gets saved has a timestamp of type timestamp without timezone in postgres. I am saving rows with time.Now() in Golang. Now, when I try to retrieve data from postgres between a date range, it always fetches according to UTC time. How can I resolve this issue and fetch rows according to timezones ?

I think you need to change your database column to use timestamp with timezone

Hopefully the postgres driver does the right thing with that converting to and from time.Time.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.