mirror of
https://github.com/gregtwallace/apc-p15-tool.git
synced 2025-05-08 08:39:45 +00:00
Fix GetTime for GMT users (#13)
UPS failes to use the required `+` when in the GMT timezone. Account for that. --------- Co-authored-by: Greg T. Wallace <greg@gregtwallace.com>
This commit is contained in:
parent
c5bb8edbec
commit
096b50187a
1 changed files with 6 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue