diff options
author | Unknwon <u@gogs.io> | 2015-08-20 00:32:18 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-20 00:32:18 +0800 |
commit | 6c2536b89c30ef1c99752abd50fdb3b5d2cd0691 (patch) | |
tree | 72c714503f60d2603dcda67f98bbc41f8e96c5be /models | |
parent | a5b09b30d0f97b7296f23940dc64fff5bf698988 (diff) |
fix timezone
Diffstat (limited to 'models')
-rw-r--r-- | models/action.go | 3 | ||||
-rw-r--r-- | models/issue.go | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/models/action.go b/models/action.go index 0e336c37..2c08eebb 100644 --- a/models/action.go +++ b/models/action.go @@ -82,7 +82,8 @@ type Action struct { func (a *Action) AfterSet(colName string, _ xorm.Cell) { switch colName { case "created": - a.Created = a.Created.UTC() + now := time.Now() + a.Created = a.Created.Add(now.Sub(now.UTC())) } } diff --git a/models/issue.go b/models/issue.go index 75345217..5e5c79c2 100644 --- a/models/issue.go +++ b/models/issue.go @@ -93,7 +93,8 @@ func (i *Issue) AfterSet(colName string, _ xorm.Cell) { log.Error(3, "GetUserByID[%d]: %v", i.ID, err) } case "created": - i.Created = i.Created.UTC() + now := time.Now() + i.Created = i.Created.Add(now.Sub(now.UTC())) } } @@ -1359,7 +1360,8 @@ func (c *Comment) AfterSet(colName string, _ xorm.Cell) { } } case "created": - fmt.Println(1, c.Created) + now := time.Now() + c.Created = c.Created.Add(now.Sub(now.UTC())) } } |