timerange

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Range

type Range struct {
	Start time.Time
	End   time.Time
}

func New

func New(start, end time.Time) (Range, error)

New returns a new Range with the given Start and End times. New will return an error if the End time is before the Start time.

func NewInstant

func NewInstant(t time.Time) Range

NewInstant returns a Range where the Start and End times are both set to the given time.

func (Range) IsInstant

func (r Range) IsInstant() bool

IsInstant returns true when the Start an End times are equal.

func (Range) IsZero

func (r Range) IsZero() bool

IsZero returns true when both the Start and End times are zero.

Jump to

Keyboard shortcuts

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