timex

package
v1.12.3 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DateFormat     = "2006-01-02"
	TimeFormat     = "15:04:05"
	DateTimeFormat = "2006-01-02 15:04:05"
)

Variables

View Source
var (
	UTC, _ = time.LoadLocation("UTC")
	GMT, _ = time.LoadLocation("GMT")
	CET, _ = time.LoadLocation("CET")
	PRC, _ = time.LoadLocation("PRC")
)

Functions

func BeginOfDay

func BeginOfDay() time.Time

func BeginOfHalf

func BeginOfHalf() time.Time

func BeginOfHour

func BeginOfHour() time.Time

func BeginOfMinute

func BeginOfMinute() time.Time

func BeginOfMonth

func BeginOfMonth() time.Time

func BeginOfQuarter

func BeginOfQuarter() time.Time

func BeginOfWeek

func BeginOfWeek(weekStartDays ...time.Weekday) time.Time

func BeginOfYear

func BeginOfYear() time.Time

func EndOfDay

func EndOfDay() time.Time

func EndOfHalf

func EndOfHalf() time.Time

func EndOfHour

func EndOfHour() time.Time

func EndOfMinute

func EndOfMinute() time.Time

func EndOfMonth

func EndOfMonth() time.Time

func EndOfQuarter

func EndOfQuarter() time.Time

func EndOfWeek

func EndOfWeek(weekStartDays ...time.Weekday) time.Time

func EndOfYear

func EndOfYear() time.Time

func MustParse

func MustParse(v any, l ...*time.Location) time.Time

func Parse

func Parse(v any, l ...*time.Location) (time.Time, error)

Types

type Time

type Time struct {
	time.Time
}

func New

func New(ts ...time.Time) *Time

func (*Time) BeginOfDay

func (t *Time) BeginOfDay() time.Time

func (*Time) BeginOfHalf

func (t *Time) BeginOfHalf() time.Time

func (*Time) BeginOfHour

func (t *Time) BeginOfHour() time.Time

func (*Time) BeginOfMinute

func (t *Time) BeginOfMinute() time.Time

func (*Time) BeginOfMonth

func (t *Time) BeginOfMonth() time.Time

func (*Time) BeginOfQuarter

func (t *Time) BeginOfQuarter() time.Time

func (*Time) BeginOfWeek

func (t *Time) BeginOfWeek(weekStartDays ...time.Weekday) time.Time

func (*Time) BeginOfYear

func (t *Time) BeginOfYear() time.Time

func (*Time) EndOfDay

func (t *Time) EndOfDay() time.Time

func (*Time) EndOfHalf

func (t *Time) EndOfHalf() time.Time

func (*Time) EndOfHour

func (t *Time) EndOfHour() time.Time

func (*Time) EndOfMinute

func (t *Time) EndOfMinute() time.Time

func (*Time) EndOfMonth

func (t *Time) EndOfMonth() time.Time

func (*Time) EndOfQuarter

func (t *Time) EndOfQuarter() time.Time

func (*Time) EndOfWeek

func (t *Time) EndOfWeek(weekStartDays ...time.Weekday) time.Time

func (*Time) EndOfYear

func (t *Time) EndOfYear() time.Time

Jump to

Keyboard shortcuts

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