]> source.dussan.org Git - gitea.git/commitdiff
#1500 use UTC for TimeSince
authorUnknwon <u@gogs.io>
Wed, 19 Aug 2015 16:16:54 +0000 (00:16 +0800)
committerUnknwon <u@gogs.io>
Wed, 19 Aug 2015 16:16:54 +0000 (00:16 +0800)
modules/base/tool.go

index 16759f21f6a9d5c4195ce5d2d9b6379a5df47581..7cf0e8544646cb568c29737269a2cf1c3d1a0ef0 100644 (file)
@@ -252,7 +252,7 @@ func computeTimeDiff(diff int64) (int64, string) {
 
 // TimeSincePro calculates the time interval and generate full user-friendly string.
 func TimeSincePro(then time.Time) string {
-       now := time.Now()
+       now := time.Now().UTC()
        diff := now.Unix() - then.Unix()
 
        if then.After(now) {
@@ -272,7 +272,7 @@ func TimeSincePro(then time.Time) string {
 }
 
 func timeSince(then time.Time, lang string) string {
-       now := time.Now()
+       now := time.Now().UTC()
 
        lbl := i18n.Tr(lang, "tool.ago")
        diff := now.Unix() - then.Unix()