VOL-1886 watch interadapter bus
Change-Id: I14cd3a9d0ca80348aab80326c28cc56380f88882
diff --git a/internal/pkg/commands/events.go b/internal/pkg/commands/events.go
index 5aa9751..f237878 100644
--- a/internal/pkg/commands/events.go
+++ b/internal/pkg/commands/events.go
@@ -132,6 +132,16 @@
// Voltha-Protos 3.2.2 and below
return time.Unix(int64(tsFloat), 0), nil
}
+ tsInt64, okay := tsIntf.(int64)
+ if okay {
+ if tsInt64 > 10000000000000 {
+ // sometimes it's in nanoseconds
+ return time.Unix(tsInt64/1000000000, tsInt64%1000000000), nil
+ } else {
+ // sometimes it's in seconds
+ return time.Unix(tsInt64/1000, 0), nil
+ }
+ }
return time.Time{}, errors.New("Failed to decode timestamp")
}