Skip to content

Commit ff1d4e2

Browse files
authored
Merge pull request #619 from jacksontj/time_formatting
Handle formatting when the time in nanoseconds requires more than a single int64
2 parents b4cb89a + cd27091 commit ff1d4e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/prometheus/v1/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,5 +873,5 @@ func (c apiClient) Do(ctx context.Context, req *http.Request) (*http.Response, [
873873
}
874874

875875
func formatTime(t time.Time) string {
876-
return strconv.FormatFloat(float64(t.UnixNano())/1e9, 'f', -1, 64)
876+
return strconv.FormatFloat(float64(t.Unix())+float64(t.Nanosecond())/1e9, 'f', -1, 64)
877877
}

0 commit comments

Comments
 (0)