date

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Date

func Date(year int, month time.Month, day int) time.Time

Date creates a new date.

func EndOf

func EndOf(d time.Time, p Period) time.Time

EndOf returns the last date in the given period that contains the receiver.

func Series

func Series(t0, t1 time.Time, p Period) []time.Time

Series returns a series of dates in the given interval, which contains both t0 and t1.

func StartOf

func StartOf(d time.Time, p Period) time.Time

StartOf returns the first date in the given period which contains the receiver.

Types

type Period

type Period int

Period is a time interval.

const (
	// Once represents the beginning of the interval.
	Once Period = iota
	// Daily is a daily interval.
	Daily
	// Weekly is a weekly interval.
	Weekly
	// Monthly is a monthly interval.
	Monthly
	// Quarterly is a quarterly interval.
	Quarterly
	// Yearly is a yearly interval.
	Yearly
)

func (Period) String

func (p Period) String() string

Jump to

Keyboard shortcuts

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