From 4fd55daafe64f6101dde5c0a8a6887fef0ff0545 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 8 Nov 2018 03:58:01 +0100 Subject: tai64n: use proper nanoseconds offset The code before was obviously wrong. Reported-by: Vlad Krasnov --- tai64n/tai64n.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tai64n') diff --git a/tai64n/tai64n.go b/tai64n/tai64n.go index 146126f..069d830 100644 --- a/tai64n/tai64n.go +++ b/tai64n/tai64n.go @@ -20,7 +20,7 @@ func Now() Timestamp { var tai64n Timestamp now := time.Now() secs := base + uint64(now.Unix()) - nano := uint32(now.UnixNano()) + nano := uint32(now.Nanosecond()) binary.BigEndian.PutUint64(tai64n[:], secs) binary.BigEndian.PutUint32(tai64n[8:], nano) return tai64n -- cgit v1.2.3