core: github.com/katzenpost/core/epochtime Index | Files

package epochtime

import "github.com/katzenpost/core/epochtime"

Package epochtime implements Katzenpost epoch related timekeeping functions.

Index

Package Files

time.go

Variables

var Epoch = time.Date(2017, 6, 1, 0, 0, 0, 0, time.UTC)

Epoch is the Katzenpost epoch expressed in UTC.

var Period = 3 * time.Hour

Period is the duration of a Katzenpost epoch.

var WarpedEpoch string

WarpedEpoch is a flag that can be passed at build time to set the epoch Period

func FromUnix Uses

func FromUnix(t int64) (current uint64, elapsed, till time.Duration)

FromUnix returns the Katzenpost epoch, time since the start of the current epoch, and time till the next epoch relative to a Unix time in seconds.

func IsInEpoch Uses

func IsInEpoch(e uint64, t uint64) bool

IsInEpoch returns true iff the epoch e contains the time t, measured in the number of seconds since the UNIX epoch.

func Now Uses

func Now() (current uint64, elapsed, till time.Duration)

Now returns the current Katzenpost epoch, time since the start of the current epoch, and time till the next epoch.

Package epochtime imports 1 packages (graph) and is imported by 12 packages. Updated 2019-03-28. Refresh now. Tools for package owners.