diff --git a/pkg/apcssh/cmd_gettime.go b/pkg/apcssh/cmd_gettime.go index 7da6397..139b0ba 100644 --- a/pkg/apcssh/cmd_gettime.go +++ b/pkg/apcssh/cmd_gettime.go @@ -28,6 +28,12 @@ func (cli *Client) GetTime() (time.Time, error) { formatUPSVal := datePieces[3] timeZoneVal := datePieces[4] + // GMT time requires + prefix + // APC UPS fails to use the required +, so add it + if timeZoneVal == "00:00" { + timeZoneVal = "+" + timeZoneVal + } + // known APC UPS format strings dateFormatVal := "" switch formatUPSVal {