From cd27091e7936ab0d1d74cf560cf4c9529c8e56a8 Mon Sep 17 00:00:00 2001 From: Thomas Jackson Date: Tue, 9 Jul 2019 09:23:52 -0700 Subject: [PATCH] Handle formatting when the time in nanoseconds requires more than a single int64 Signed-off-by: Thomas Jackson Fixup for #617 --- api/prometheus/v1/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/prometheus/v1/api.go b/api/prometheus/v1/api.go index 86c14ea..1845ef6 100644 --- a/api/prometheus/v1/api.go +++ b/api/prometheus/v1/api.go @@ -873,5 +873,5 @@ func (c apiClient) Do(ctx context.Context, req *http.Request) (*http.Response, [ } func formatTime(t time.Time) string { - return strconv.FormatFloat(float64(t.UnixNano())/1e9, 'f', -1, 64) + return strconv.FormatFloat(float64(t.Unix())+float64(t.Nanosecond())/1e9, 'f', -1, 64) }