timeutil

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Human

func Human(then time.Time) string

Human turns the time into a relative expression of time meant for human consumption. Human(t) --> "today at 07:47"

func MockTimeNow

func MockTimeNow(f func() time.Time) (restorer func())

MockTimeNow mocks the time.Now() calls used in the timeutil package.

Types

type TimeUTC

type TimeUTC time.Time

TimeUTC is like time.Time but converts to UTC when (un)marshalled.

func (TimeUTC) MarshalText

func (t TimeUTC) MarshalText() ([]byte, error)

func (TimeUTC) MarshalYAML

func (t TimeUTC) MarshalYAML() (any, error)

func (*TimeUTC) UnmarshalText

func (t *TimeUTC) UnmarshalText(data []byte) error

func (*TimeUTC) UnmarshalYAML

func (t *TimeUTC) UnmarshalYAML(value *yaml.Node) error

Jump to

Keyboard shortcuts

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