ntp

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const JAN_1970 = 2208988800

JAN_1970 is the Unix Epoch in NTP Seconds (1970 - 1900)

Variables

This section is empty.

Functions

func TimeToNtp

func TimeToNtp(t time.Time) string

Types

type Timestamp

type Timestamp struct {
	Seconds  uint32
	Fraction uint32
}

Timestamp represents a NTP timestamp. The code is from `github.com/coreos/mantle` under the Apache 2.0 license.

func NewTimestamp

func NewTimestamp(t time.Time) Timestamp

NewTimestamp converts from Go's Time to NTP's 64-bit Timestamp format.

func Now

func Now() Timestamp

Now gets the current NTP time in the 64-bit Timestamp format.

func (Timestamp) String

func (ts Timestamp) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL