Skip to content

Commit

Permalink
fixing timezones
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jun 26, 2024
1 parent 49102cf commit 4a5392a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/spks.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ func SpksCMD(allMetrics map[string]map[string]prometheus.Counter, ctx context.Co
now := time.Now().In(location)
// this variable is necessary to query Prometheus, with timerange [1d:1d] it returns data from 1 day up to midnight
startOfToday := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, location)
startYesterdayAbsolute := time.Date(now.Year(), now.Month(), now.Day()-1, 0, 0, 0, 0, location).In(time.UTC)
endYesterdayAbsolute := time.Date(now.Year(), now.Month(), now.Day()-1, 23, 59, 59, 0, location).In(time.UTC)
startYesterdayAbsolute := time.Date(now.Year(), now.Month(), now.Day()-1, 0, 0, 0, 0, time.UTC)
endYesterdayAbsolute := startYesterdayAbsolute.Add(24 * time.Hour)

odooClient := odoo.NewOdooAPIClient(c.Context, odooURL, odooOauthTokenURL, odooClientId, odooClientSecret, logger, allMetrics["odooMetrics"])

Expand Down

0 comments on commit 4a5392a

Please sign in to comment.