timeutil

package
v0.78.0 Latest Latest
Warning

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

Go to latest
Published: Dec 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 ApproximateBins added in v0.58.0

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

func OffsetTime added in v0.60.7

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

func TimeGrainToAPI added in v0.78.0

func TimeGrainToAPI(tg TimeGrain) runtimev1.TimeGrain

func TruncateTime

func TruncateTime(tm 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
)

func TimeGrainFromAPI added in v0.78.0

func TimeGrainFromAPI(tg runtimev1.TimeGrain) TimeGrain

Jump to

Keyboard shortcuts

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