time

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateStepsForTimeRange

func CalculateStepsForTimeRange(from, to time.Time, steps int) time.Duration

CalculateStepsForTimeRange calculates the step duration for a given time range and number of steps.

func EndOfMonth

func EndOfMonth(t time.Time) time.Time

EndOfMonth returns the last TS of the month for the given time.

func EndOfQuarter

func EndOfQuarter(t time.Time) time.Time

EndOfQuarter returns the last TS of the quarter for the given time.

func EndOfWeek

func EndOfWeek(t time.Time) time.Time

EndOfWeek returns the last TS of the week for the given time.

func EndOfYear

func EndOfYear(t time.Time) time.Time

func LastDayOfMonth

func LastDayOfMonth(t time.Time) time.Time

LastDayOfMonth returns the last day of the month for the given time.

func MonthFirst

func MonthFirst(t time.Time) time.Time

MonthFirst returns the first TS of the month for the given time.

func NextMonths

func NextMonths(t time.Time, months int) time.Time

NextMonths returns the time after adding the specified number of months to the given time.

func QuarterFirst

func QuarterFirst(t time.Time) time.Time

QuarterFirst returns the first TS of the quarter for the given time.

func RoundTimeToDay

func RoundTimeToDay(t time.Time) time.Time

RoundTimeToDay rounds a time to the start of the day (00:00:00).

func SetEndOfDay

func SetEndOfDay(t time.Time) time.Time

SetEndOfDay sets the time to the end of the day (23:59:59.999999999) in a given TS.

func WeekMonday

func WeekMonday(t time.Time) time.Time

WeekMonday returns the Monday of the week for the given time.

func YearFirst

func YearFirst(t time.Time) time.Time

YearFirst returns the first TS of the year for the given time.

Types

This section is empty.

Jump to

Keyboard shortcuts

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