Versions in this module Expand all Collapse all v1 v1.0.7 Sep 22, 2021 v1.0.6 Sep 22, 2021 v1.0.5 Sep 22, 2021 v1.0.4 Sep 22, 2021 v1.0.3 Sep 22, 2021 Changes in this version + const UNIX_STA_TIMESTAMP + func Calc(res []byte, reqTs, resTs int64) (d int64, t int64) + func GetT2T3Unix(ntpRes []byte) (int64, int64) + func NewNtpV3Req() []byte + func NtpTimestamp2Unix(ts uint64) int64 + func ParseTransmitTimestamp(ntpRes []byte) time.Time + func SimpleNtpQuery(ntp_server_addr string) (now time.Time, cast time.Duration, err error) + func TimeOfNtpServer(ntp_server_addr string) (now time.Time, cast time.Duration, err error) + func UnixTimestamp2Ntp(uts int64) uint64 + type Ntp struct + Li uint8 + Mode uint8 + OriginateTimestamp uint64 + Poll uint8 + Precision uint8 + ReceiveTimestamp uint64 + ReferenceIdentifier int32 + ReferenceTimestamp uint64 + RootDelay int32 + RootDispersion int32 + Stratum uint8 + TransmitTimestamp uint64 + Vn uint8 + func NewNtp() (p *Ntp) + func (this *Ntp) Decode(buf []byte, useUnixSec bool) + func (this *Ntp) Encode() []byte + func (this *Ntp) ToString() string