[GO][EDIT] detect-internet collector now uses a specific timezone

This commit is contained in:
BuildTools
2020-12-02 16:34:33 +01:00
parent e3a812c942
commit cb83d98dd9

View File

@@ -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,