ntp

package
v0.1.41 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package ntp provides conversion methods between time.Time and NTP timestamps stored in uint64

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToNTP

func ToNTP(t time.Time) uint64

ToNTP converts a time.Time oboject to an uint64 NTP timestamp.

func ToNTP32 added in v0.1.38

func ToNTP32(t time.Time) uint32

ToNTP32 converts a time.Time object to a uint32 NTP timestamp.

func ToTime

func ToTime(t uint64) time.Time

ToTime converts a uint64 NTP timestamps to a time.Time object.

func ToTime32 added in v0.1.38

func ToTime32(t uint32, reference time.Time) time.Time

ToTime32 converts a uint32 NTP timestamp to a time.Time object, using the highest 16 bit of the reference to recover the lost bits. The low 16 bits are not recovered.

Types

This section is empty.

Jump to

Keyboard shortcuts

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