From 76965499dc2131aad0925136f79d39080dbe00a7 Mon Sep 17 00:00:00 2001 From: congzhegao Date: Sun, 5 Nov 2023 00:30:06 -0400 Subject: [PATCH] fix time field --- management/log.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/management/log.go b/management/log.go index 9619e5fa..ed36531b 100644 --- a/management/log.go +++ b/management/log.go @@ -166,7 +166,13 @@ func (l Logv2) GetDate() time.Time { if _, ok := l["date"]; !ok { return time.Time{} } - return l["date"].(time.Time) + dateStr := l["date"].(string) + parsed, err := time.Parse(time.RFC3339, dateStr) + if err != nil { + fmt.Println("Failed to parse dateStr " + dateStr) + return time.Time{} + } + return parsed } func (l Logv2) String() string {