GORM Playground Link
https://github.com/go-gorm/playground/pull/544
Description
When
* client has non-UTC time zone;
* and postgres table contains timestamp without time zone;
* and updating a row with local time.Time,
it doesn't convert date&time to UTC, but just cuts off the time zone information.
Even more, UpdatedAt is always updated with client's local time, so literally every insert/update produces values from the past or from the future (depends on client's time zone).
For instance,
* after inserting a record, UpdatedAt has 2022-11-24 18:46:48.540855425 +0200 EET;
* but after fetching the same record, the field has 2022-11-24 18:46:48.540855 +0000 UTC.
I'd expect it returned 2022-11-24 16:46:48.540855 +0000 UTC instead.
Comment From: a631807682
https://gorm.io/docs/gorm_config.html#NowFunc