timeutil

package
v0.62.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTimeProto added in v0.58.0

func AddTimeProto(to time.Time, tg runtimev1.TimeGrain, count int) time.Time

func ApproximateBins added in v0.58.0

func ApproximateBins(start, end time.Time, tg TimeGrain) int

func CeilTime added in v0.54.0

func CeilTime(start time.Time, tg TimeGrain, tz *time.Location, firstDay, firstMonth int) time.Time

func CopyTimeComponentsUntil added in v0.60.7

func CopyTimeComponentsUntil(src, tar time.Time, until TimeGrain) time.Time

CopyTimeComponentsUntil Copies components of `src` into `tar` starting from year and going down all the way to `until` (inclusive).

func OffsetTime added in v0.60.7

func OffsetTime(tm time.Time, tg TimeGrain, n int) time.Time

func TruncateTime

func TruncateTime(start time.Time, tg TimeGrain, tz *time.Location, firstDay, firstMonth int) time.Time

Types

type TimeGrain

type TimeGrain int

TimeGrain is extension of std time package with Week and Quarter added

const (
	TimeGrainUnspecified TimeGrain = iota
	TimeGrainMillisecond
	TimeGrainSecond
	TimeGrainMinute
	TimeGrainHour
	TimeGrainDay
	TimeGrainWeek
	TimeGrainMonth
	TimeGrainQuarter
	TimeGrainYear
)

Jump to

Keyboard shortcuts

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