time

package
v0.0.0-...-e7cb044 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Day   = 24 * time.Hour
	Month = 30 * Day
	Year  = 12 * Month
)

Variables

This section is empty.

Functions

func NowUTC

func NowUTC() time.Time

NowUTC returns the time now in UTC.

Types

type Duration

type Duration = time.Duration

type Durations

type Durations []time.Duration

func (Durations) MarshalLogArray

func (d Durations) MarshalLogArray(enc zapcore.ArrayEncoder) error

func (Durations) Sort

func (d Durations) Sort()

Sort sorts the durations.

type Frame

type Frame struct {
	StartTime time.Time
	EndTime   time.Time
}

Frame represents a period of time.

func GenerateFrames

func GenerateFrames(start time.Time, duration time.Duration, n int) []*Frame

GenerateFrames generates time frames.

func (Frame) Duration

func (f Frame) Duration() Duration

Duration returns the time frame duration.

func (Frame) ToDurationString

func (f Frame) ToDurationString() string

ToDurationString converts time frame to duration string.

func (Frame) ToUnixString

func (f Frame) ToUnixString() string

ToUnixString converts time frame to unix string.

func (*Frame) UTC

func (f *Frame) UTC()

UTC sets the time frame to UTC.

Jump to

Keyboard shortcuts

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