diff options
author | Unknwon <u@gogs.io> | 2016-03-09 19:53:30 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-03-09 19:53:30 -0500 |
commit | ad513a20e939691828ba415c9a565e8ff3daa95f (patch) | |
tree | c15aa2c82a5ed242ba51c837804f050690dd60ad /models/models.go | |
parent | 0c9a616326ba096a2ff6c058cc96950f68c0fa6e (diff) | |
download | gitea-ad513a20e939691828ba415c9a565e8ff3daa95f.tar.gz gitea-ad513a20e939691828ba415c9a565e8ff3daa95f.zip |
#2302 Replace time.Time with Unix Timestamp (int64)
Diffstat (limited to 'models/models.go')
-rw-r--r-- | models/models.go | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/models/models.go b/models/models.go index 2e91f71690..b705bdad41 100644 --- a/models/models.go +++ b/models/models.go @@ -11,16 +11,13 @@ import ( "os" "path" "strings" - "time" - "github.com/Unknwon/com" _ "github.com/go-sql-driver/mysql" "github.com/go-xorm/core" "github.com/go-xorm/xorm" _ "github.com/lib/pq" "github.com/gogits/gogs/models/migrations" - "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/setting" ) @@ -44,27 +41,6 @@ func sessionRelease(sess *xorm.Session) { sess.Close() } -// Note: get back time.Time from database Go sees it at UTC where they are really Local. -// So this function makes correct timezone offset. -func regulateTimeZone(t time.Time) time.Time { - if !setting.UseMySQL { - return t - } - - zone := t.Local().Format("-0700") - if len(zone) != 5 { - log.Error(4, "Unprocessable timezone: %s - %s", t.Local(), zone) - return t - } - hour := com.StrTo(zone[2:3]).MustInt() - minutes := com.StrTo(zone[3:5]).MustInt() - - if zone[0] == '-' { - return t.Add(time.Duration(hour) * time.Hour).Add(time.Duration(minutes) * time.Minute) - } - return t.Add(-1 * time.Duration(hour) * time.Hour).Add(-1 * time.Duration(minutes) * time.Minute) -} - var ( x *xorm.Engine tables []interface{} |