tai64n: add string representation for error messages
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
01e176af3c
commit
9c7bd73be2
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue