From 7dfefedf77dd6905f4850eb18a6194685e903e3b Mon Sep 17 00:00:00 2001 From: UlricQin Date: Mon, 1 Jun 2020 16:26:41 +0800 Subject: [PATCH] fix time location parse --- src/modules/collector/log/worker/worker.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/collector/log/worker/worker.go b/src/modules/collector/log/worker/worker.go index 8cea81a4..091ab1ad 100644 --- a/src/modules/collector/log/worker/worker.go +++ b/src/modules/collector/log/worker/worker.go @@ -224,7 +224,8 @@ func (w *Worker) producer(line string, strategy *stra.Strategy) (*AnalysPoint, e t = reg.ReplaceAllString(t, rep) } - tms, err := time.Parse(timeFormat, t) + loc, err := time.LoadLocation("Local") + tms, err := time.ParseInLocation(timeFormat, t, loc) if err != nil { return nil, err }