time

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Day   = 24 * time.Hour
	Week  = 7 * Day
	Month = 30 * Day
	Year  = 365 * Day
)

Variables

This section is empty.

Functions

func Format

func Format(t time.Time) string

func InRange

func InRange(t time.Time, start, end time.Time) bool

func MustParse

func MustParse(s string) time.Time

func Parse

func Parse(s string) (time.Time, error)

func Random

func Random(max time.Duration) time.Duration

func SetLocation

func SetLocation(name string) error

SetLocation sets the location for the current application.

func Tick

func Tick(ctx context.Context, d time.Duration, f func() error) error

Types

type Duration added in v0.2.2

type Duration time.Duration

func (Duration) MarshalJSON added in v0.2.2

func (d Duration) MarshalJSON() ([]byte, error)

func (Duration) MarshalYAML added in v0.2.2

func (d Duration) MarshalYAML() (interface{}, error)

func (Duration) String added in v0.2.2

func (d Duration) String() string

func (*Duration) UnmarshalJSON added in v0.2.2

func (d *Duration) UnmarshalJSON(b []byte) error

func (*Duration) UnmarshalYAML added in v0.2.2

func (d *Duration) UnmarshalYAML(value *yaml.Node) error

Jump to

Keyboard shortcuts

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