Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. # golang
  2. tai64n := make([]byte, 12)
  3. binary.BigEndian.PutUint64(tai64n[:], 4611686018427387914+uint64(now.Unix()))
  4. binary.BigEndian.PutUint32(tai64n[8:], uint32(now.Nanosecond()))
  5.  
  6. # python
  7. now = datetime.datetime.now()
  8. tai = struct.pack('!qi', 4611686018427387914 + int(now.timestamp()), int(now.microsecond * 1e3))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement