timey

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDays

func AddDays(t time.Time, n int) time.Time

AddDays adds the given number of days to the given time

func AddHours

func AddHours(t time.Time, n int) time.Time

AddHours adds the given number of hours to the given time

func AddMonths

func AddMonths(t time.Time, n int) time.Time

AddMonths adds the given number of months to the given time

func DiffEqual

func DiffEqual(d time.Duration, t0 time.Time, ts ...time.Time) bool

DiffEqual returns true if all ts inputs are within duration d range of t0.

func DurationAbs

func DurationAbs(d time.Duration) time.Duration

DurationAbs returns the absolute (positive) value of a time.Duration.

func Pointer

func Pointer(v time.Time) *time.Time

Pointer returns a pointer to the given time.Time. NOTE: this method is deprecated. Use helpy.Pointer instead.

func TimeOrDefault

func TimeOrDefault(v *time.Time, defaultVal time.Time) *time.Time

TimeOrDefault returns time.Time if it is not nil, and a pointer to defaultVal otherwise. NOTE: this method is deprecated. Use helpy.DerefOrValue instead.

func TruncEqual

func TruncEqual(d time.Duration, t0 time.Time, ts ...time.Time) bool

TruncEqual truncates t0 and ts inputs down to a multiple of d (since the zero time) and returns true if all ts are equal to t0.

Types

This section is empty.

Jump to

Keyboard shortcuts

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