From 9c7bd73be2cc7b706d471cd34d718852457e8cef Mon Sep 17 00:00:00 2001
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
Date: Wed, 3 Feb 2021 17:56:46 +0100
Subject: [PATCH] tai64n: add string representation for error messages

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 tai64n/tai64n.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tai64n/tai64n.go b/tai64n/tai64n.go
index 4f4ebab..e1fa26a 100644
--- a/tai64n/tai64n.go
+++ b/tai64n/tai64n.go
@@ -33,3 +33,7 @@ func Now() Timestamp {
 func (t1 Timestamp) After(t2 Timestamp) bool {
 	return bytes.Compare(t1[:], t2[:]) > 0
 }
+
+func (t Timestamp) String() string {
+	return time.Unix(int64(binary.BigEndian.Uint64(t[:8])-base), int64(binary.BigEndian.Uint32(t[8:12]))).String()
+}