소스 검색

#1500 use UTC for TimeSince

Unknwon 9 년 전
부모
커밋
390027496c
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      modules/base/tool.go

+ 2 - 2
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()