Skip to content

Commit f6720fc

Browse files
authored
Update time since formatting (#1558)
1 parent 94f6ddb commit f6720fc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/lib/time/time.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ func DifferenceStr(t1 *time.Time, t2 *time.Time) string {
7373
if durationSecs < 60 {
7474
return strconv.Itoa(durationSecs) + "s"
7575
} else if durationSecs < 3600 {
76-
return strconv.Itoa(durationSecs/60) + "m"
76+
return strconv.Itoa(durationSecs/60) + "m" + strconv.Itoa(durationSecs-durationSecs/60*60) + "s"
7777
} else if durationSecs < 48*3600 {
78-
return strconv.Itoa(durationSecs/3600) + "h"
78+
return strconv.Itoa(durationSecs/3600) + "h" + strconv.Itoa((durationSecs-durationSecs/3600*3600)/60) + "m"
7979
} else {
80-
return strconv.Itoa(durationSecs/(24*3600)) + "d"
80+
return strconv.Itoa(durationSecs/(24*3600)) + "d" + strconv.Itoa((durationSecs-durationSecs/(24*3600)*(24*3600))/3600) + "h"
8181
}
8282
}
8383

0 commit comments

Comments
 (0)