Gorm: about the created_at time zone

Created on 30 Sep 2014  路  3Comments  路  Source: go-gorm/gorm

When created new record, the created_at insert value is 2014-09-30 00:58:27, and my computer local time is 2014-09-30 08:58:27, the time zone should be +8
Is there a method can set the time zone, like gorm.SetTimeZone("Shanghai"), or gorm.SetTimeZone(+8)?

Most helpful comment

you miss "&loc=Local" parameter when connect database. And it causes my above problem.

All 3 comments

the same question!!
I think the golang time package is the most difficult package to use ....

you miss "&loc=Local" parameter when connect database. And it causes my above problem.

@vutung7193 I believe not every database adapters have this option. At least not for Postgres

Was this page helpful?
0 / 5 - 0 ratings