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

Related issues

badoet picture badoet  ·  162Comments

cihangir picture cihangir  ·  19Comments

badoet picture badoet  ·  15Comments

jinzhu picture jinzhu  ·  216Comments

MikeJinhua picture MikeJinhua  ·  14Comments