From cb83d98dd9a7310c1c33850aff8622ab66dffb9c Mon Sep 17 00:00:00 2001 From: BuildTools Date: Wed, 2 Dec 2020 16:34:33 +0100 Subject: [PATCH] [GO][EDIT] detect-internet collector now uses a specific timezone --- collector/internet_collector.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/collector/internet_collector.go b/collector/internet_collector.go index ddb1ff0..17481d9 100644 --- a/collector/internet_collector.go +++ b/collector/internet_collector.go @@ -59,12 +59,14 @@ func (c *internetCollector) collect(ctx *collectorContext) error { // This function parses the status and the last change time of a specific interface func (c *internetCollector) collectStatusForEth(name string, se *proto.Sentence, ctx *collectorContext) { layout := "Jan/02/2006 15:04:05" + // Set specific Timezone + loc, _ := time.LoadLocation("Europe/Paris") // Parse date v, ok := se.Map["state-change-time"] if !ok { return } - t, err := time.Parse(layout, v) + t, err := time.ParseInLocation(layout, v, loc) if err != nil { log.WithFields(log.Fields{ "device": ctx.device.Name,