times

package
v0.0.0-...-c18a219 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 7 Imported by: 6

Documentation

Index

Constants

View Source
const (
	Day  = time.Hour * 24
	Week = Day * 7
)

Variables

This section is empty.

Functions

func Date

func Date(t time.Time) time.Time

func Days

func Days(n int32) time.Duration

func Format

func Format(t time.Time, layout string) string

Format format time with .NET time pattern.

func FromUnixMilli

func FromUnixMilli(ms int64) time.Time

func Hours

func Hours(n int32) time.Duration

func Milliseconds

func Milliseconds(n int32) time.Duration

func Minutes

func Minutes(n int32) time.Duration

func Seconds

func Seconds(n int32) time.Duration

func ToUnixMilli

func ToUnixMilli(t time.Time) int64

func Today

func Today() time.Time

func Tomorrow

func Tomorrow() time.Time

func Weeks

func Weeks(n int32) time.Duration

func Yesterday

func Yesterday() time.Time

Types

type Wheel

type Wheel struct {
	// contains filtered or unexported fields
}

Wheel is a time wheel like a clock.

func NewWheel

func NewWheel(interval time.Duration, count int) *Wheel

NewWheel creates a Wheel.

func (*Wheel) Add

func (w *Wheel) Add(action func() bool)

Add adds an action to tail. If action return true, it will be fired again at next cycle.

func (*Wheel) Stop

func (w *Wheel) Stop()

Stop prevents the wheel from firing.

Jump to

Keyboard shortcuts

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