Updating UpdateAt
with .Save
does not use the given value
#7238
Labels
type:critical
critical questions
UpdateAt
with .Save
does not use the given value
#7238
GORM Playground Link
I will add the link later, can't do it now, but I think the description is enough to understand the issue:
https://github.com/go-gorm/playground
Description
I'm using the following code to create a
thread_update
. See that I'm passing theUpdatedAt
value.The generated SQL is as below. See that the
UpdatedAt
passed toVALUES
is 12:55, which is correctly set to UTC, but theUPDATE SET
clause forupdated_at
has my local time 09:55.Expectation
It should be using the value I passed in for
UpdatedAt
both for inVALUES
andUPDATE SET
."Quick-fix" (not exactly...)
If you have a the same problem with
UpdatedAt
, you can pass a function togorm.Open
to useUTC
(or whatever timezone) as a configuration:The text was updated successfully, but these errors were encountered: