summaryrefslogtreecommitdiffhomepage
path: root/src/tai64.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2018-02-04 16:08:26 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2018-02-04 16:08:26 +0100
commita0f54cbe5ac2cd8b8296c2c57c30029dd349cff0 (patch)
tree64574090d79ff3899c5c18e5268e450028e4656b /src/tai64.go
parent5871ec04deb8f4715cab37146940baa35c08cbee (diff)
Align with go library layout
Diffstat (limited to 'src/tai64.go')
-rw-r--r--src/tai64.go28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/tai64.go b/src/tai64.go
deleted file mode 100644
index 2299a37..0000000
--- a/src/tai64.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package main
-
-import (
- "bytes"
- "encoding/binary"
- "time"
-)
-
-const (
- TAI64NBase = uint64(4611686018427387914)
- TAI64NSize = 12
-)
-
-type TAI64N [TAI64NSize]byte
-
-func Timestamp() TAI64N {
- var tai64n TAI64N
- now := time.Now()
- secs := TAI64NBase + uint64(now.Unix())
- nano := uint32(now.UnixNano())
- binary.BigEndian.PutUint64(tai64n[:], secs)
- binary.BigEndian.PutUint32(tai64n[8:], nano)
- return tai64n
-}
-
-func (t1 *TAI64N) After(t2 TAI64N) bool {
- return bytes.Compare(t1[:], t2[:]) > 0
-}