diff options
author | Unknwon <u@gogs.io> | 2015-08-20 00:16:54 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-20 00:16:54 +0800 |
commit | 390027496c26402c0e4cf985ea225dd7be0a2433 (patch) | |
tree | 8f130685a2c331cce85898099d1d0405e89f9a15 | |
parent | b846f195c11808d3ed302c4d854d5eb700fdf1dc (diff) | |
download | gitea-390027496c26402c0e4cf985ea225dd7be0a2433.tar.gz gitea-390027496c26402c0e4cf985ea225dd7be0a2433.zip |
#1500 use UTC for TimeSince
-rw-r--r-- | modules/base/tool.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/base/tool.go b/modules/base/tool.go index 16759f21f6..7cf0e85446 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -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() |