Skip to content

Commit

Permalink
fixing timestamp parsing in test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
sebito91 committed Feb 10, 2018
1 parent 1b21875 commit 5d19e43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9123,7 +9123,7 @@ func TestServer_AlertHandlers(t *testing.T) {
CustomDetails: map[string]interface{}{
"raw_details": "details",
},
Timestamp: time.Date(1970, time.January, 1, 0, 0, 0, 0, time.UTC),
Timestamp: "1970-01-01T00:00:00.000000001Z",
},
RoutingKey: "service_key",
},
Expand Down
2 changes: 1 addition & 1 deletion services/pagerduty2/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func (s *Service) preparePost(serviceKey, incidentKey, desc string, level alert.

m := timestamp.Format(time.RFC3339Nano)
if timestamp.Nanosecond() == 0 {
m = time.Unix(timestamp.Unix(), 1).Format(time.RFC3339Nano)
m = time.Unix(timestamp.Unix(), 1).In(timestamp.Location()).Format(time.RFC3339Nano)
}

ap.Payload.Class = data.TaskName
Expand Down

0 comments on commit 5d19e43

Please sign in to comment.