From 192021b405f85976b958f774668219656b3e784f Mon Sep 17 00:00:00 2001
From: FingerlessGloves <me@FingerlessGloves.me>
Date: Mon, 17 Mar 2025 12:46:35 +0000
Subject: [PATCH] Fix GetTime for GMT users

---
 pkg/apcssh/cmd_gettime.go | 5 +++++
 1 file changed, 5 insertions(+)

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