0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-19 00:11:24 +01:00

#1500 use UTC for TimeSince

This commit is contained in:
Unknwon 2015-08-20 00:16:54 +08:00
parent b846f195c1
commit 390027496c

View file

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