From 9bf7f9e7cc65cef5e5f52684d4b2182cc27a9f72 Mon Sep 17 00:00:00 2001 From: Daniel Rocha Date: Wed, 4 Apr 2018 16:56:56 +0200 Subject: [PATCH] Print correted date instead of offset --- htpdate.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htpdate.go b/htpdate.go index ea07dd3..960d229 100644 --- a/htpdate.go +++ b/htpdate.go @@ -58,5 +58,6 @@ func main() { sumT += theta / delta sumD += 1 / delta } - fmt.Printf("offset %.5f sec\n", sumT/sumD) + offset := time.Duration(1e9 * sumT / sumD) + fmt.Println(time.Now().Add(offset).Format(time.RFC3339Nano)) }