Skip to content

Commit cd27091

Browse files
committed
Handle formatting when the time in nanoseconds requires more than a single int64
Signed-off-by: Thomas Jackson <[email protected]> Fixup for #617
1 parent b4cb89a commit cd27091

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)