Skip to content

Commit

Permalink
re-commit of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
RichBarnes committed Dec 11, 2023
1 parent c2799f5 commit 8d0d5c5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkg/sdk/resource_monitors.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"strconv"
"strings"
"time"
)

var (
Expand Down Expand Up @@ -98,16 +97,19 @@ func (row *resourceMonitorRow) convert() (*ResourceMonitor, error) {
resourceMonitor.Frequency = *frequency
}
if row.StartTime.Valid {
const YYMMDDhhmm = "2006-01-02 15:04"
t, err := time.Parse(time.RFC3339, row.StartTime.String)
convertedStartTime, err := ParseTimestampWithOffset(row.StartTime.String, "2006-01-02 15:04")
if err != nil {
return nil, err
}
localTime := t.Local()
resourceMonitor.StartTime = localTime.Format(YYMMDDhhmm)
resourceMonitor.StartTime = convertedStartTime
}

if row.EndTime.Valid {
resourceMonitor.EndTime = row.EndTime.String
convertedEndTime, err := ParseTimestampWithOffset(row.EndTime.String, "2006-01-02 15:04")
if err != nil {
return nil, err
}
resourceMonitor.EndTime = convertedEndTime
}
suspendTriggers, err := extractTriggerInts(row.SuspendAt)
if err != nil {
Expand Down

0 comments on commit 8d0d5c5

Please sign in to comment.