Hi, I’m using Gorm and I’m doing this test where i insert a record, then I retrieve it, and finally I compare both of them using reflect.DeepEqual.
I get differences in the created_at field (TIMESTAMP WITH TIME ZONE) because when I retrieve it, I get the time in UTC, while when the struct is created i get the local timezone.
I’ve been doing some research and I found that CockroachDB has a SET TIME ZONE command, but I couldn’t find what are the implications of using one or another.
- Should I always use UTC in the database or my local timezone? (I’m not working globally, one timezone should be ok)
- Can I change the timezone settings if the database already has data?
- I tried to change CockroachDB time zone, but I couldn’t find the Argentina’s timezone (tried ART and UTC-03).
- I’ve found that gorm has a setting “loc=Local”, I used but nothing changed… Is it implemented in CockroachDB?