fix health lastSeen format

This commit is contained in:
yusing
2024-12-18 10:49:33 +08:00
parent 57a7c04a4c
commit 34d5edd6b9
3 changed files with 9 additions and 6 deletions

View File

@@ -45,6 +45,13 @@ func FormatDuration(d time.Duration) string {
return strings.Join(parts[:len(parts)-1], ", ") + " and " + parts[len(parts)-1]
}
func FormatLastSeen(t time.Time) string {
if t.IsZero() {
return "never"
}
return FormatTime(t)
}
func FormatTime(t time.Time) string {
return t.Format("2006-01-02 15:04:05")
}