X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=tai64n.go;h=473c7e8083e66db6c9118f2956dce816c29ba798;hb=266a0ae363ebb2c96e0a1d700c20bfc3a3188788;hp=34a63d185c2c1e351d1920394ed6bca71c7667b4;hpb=4aa3fe62a67788000896fc2b7f17f1078192bbe7;p=gotai64n.git diff --git a/tai64n.go b/tai64n.go index 34a63d1..473c7e8 100644 --- a/tai64n.go +++ b/tai64n.go @@ -1,6 +1,6 @@ /* go.cypherpunks.ru/tai64n -- Pure Go TAI64N implementation -Copyright (C) 2020 Sergey Matveev +Copyright (C) 2020-2021 Sergey Matveev This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,9 +33,9 @@ const ( type TAI64N [Size]byte -func FromTime(t time.Time, tai *TAI64N) { - binary.BigEndian.PutUint64(tai[:], uint64(Base)+uint64(t.Unix())) - binary.BigEndian.PutUint32(tai[8:], uint32(t.Nanosecond())) +func FromTime(src time.Time, dst *TAI64N) { + binary.BigEndian.PutUint64(dst[:], uint64(Base)+uint64(src.Unix())) + binary.BigEndian.PutUint32(dst[8:], uint32(src.Nanosecond())) } func ToTime(tai []byte) time.Time {