diff options
author | Unknwon <u@gogs.io> | 2015-09-11 12:33:27 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-09-11 12:33:27 -0400 |
commit | 373ef5d15e1c2781bf47750554cb21e4ed5446c1 (patch) | |
tree | d7db662fdfae04e426376219b627d85e3b61ed2b /models | |
parent | 121a81a2c554b2de0de89ab7749fe691b5d1aba7 (diff) | |
download | gitea-373ef5d15e1c2781bf47750554cb21e4ed5446c1.tar.gz gitea-373ef5d15e1c2781bf47750554cb21e4ed5446c1.zip |
#1500 timezone minutes offset
Diffstat (limited to 'models')
-rw-r--r-- | models/models.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/models/models.go b/models/models.go index 67fa14149e..33459642d5 100644 --- a/models/models.go +++ b/models/models.go @@ -54,12 +54,13 @@ func regulateTimeZone(t time.Time) time.Time { if len(zone) != 5 { return t } - offset := com.StrTo(zone[2:3]).MustInt() + hour := com.StrTo(zone[2:3]).MustInt() + minutes := com.StrTo(zone[3:4]).MustInt() if zone[0] == '-' { - return t.Add(time.Duration(offset) * time.Hour) + return t.Add(time.Duration(hour) * time.Hour).Add(time.Duration(minutes) * time.Minute) } - return t.Add(-1 * time.Duration(offset) * time.Hour) + return t.Add(-1 * time.Duration(hour) * time.Hour).Add(-1 * time.Duration(minutes) * time.Minute) } var ( |