ztime

package
v0.0.0-...-3fc60fe Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FirstDayMonday bool
View Source
var TimeFormats = []string{"1/2/2006", "1/2/2006 15:4:5", "2006-1-2 15:4:5", "2006-1-2 15:4", "2006-1-2", "1-2", "15:4:5", "15:4", "15", "15:4:5 Jan 2, 2006 MST", "2006-01-02 15:04:05.999999999 -0700 MST"}

Functions

func BeginningOfDay

func BeginningOfDay(t time.Time) time.Time

func BeginningOfHour

func BeginningOfHour(t time.Time) time.Time

func BeginningOfMinute

func BeginningOfMinute(t time.Time) time.Time

func BeginningOfMonth

func BeginningOfMonth(t time.Time) time.Time

func BeginningOfQuarter

func BeginningOfQuarter(t time.Time) time.Time

func BeginningOfWeek

func BeginningOfWeek(t time.Time) time.Time

func BeginningOfYear

func BeginningOfYear(t time.Time) time.Time

func Between

func Between(t time.Time, time1, time2 string) bool

func EndOfDay

func EndOfDay(t time.Time) time.Time

func EndOfHour

func EndOfHour(t time.Time) time.Time

func EndOfMinute

func EndOfMinute(t time.Time) time.Time

func EndOfMonth

func EndOfMonth(t time.Time) time.Time

func EndOfQuarter

func EndOfQuarter(t time.Time) time.Time

func EndOfSunday

func EndOfSunday(t time.Time) time.Time

func EndOfWeek

func EndOfWeek(t time.Time) time.Time

func EndOfYear

func EndOfYear(t time.Time) time.Time

func Monday

func Monday(t time.Time) time.Time

func MustParse

func MustParse(t time.Time, strs ...string) time.Time

func Parse

func Parse(t time.Time, strs ...string) (time.Time, error)

func Sunday

func Sunday(t time.Time) time.Time

Types

type Now

type Now struct {
	time.Time
}

func New

func New(t time.Time) *Now

func (*Now) BeginningOfDay

func (now *Now) BeginningOfDay() time.Time

func (*Now) BeginningOfHour

func (now *Now) BeginningOfHour() time.Time

func (*Now) BeginningOfMinute

func (now *Now) BeginningOfMinute() time.Time

func (*Now) BeginningOfMonth

func (now *Now) BeginningOfMonth() time.Time

func (*Now) BeginningOfQuarter

func (now *Now) BeginningOfQuarter() time.Time

func (*Now) BeginningOfWeek

func (now *Now) BeginningOfWeek() time.Time

func (*Now) BeginningOfYear

func (now *Now) BeginningOfYear() time.Time

func (*Now) Between

func (now *Now) Between(time1, time2 string) bool

func (*Now) EndOfDay

func (now *Now) EndOfDay() time.Time

func (*Now) EndOfHour

func (now *Now) EndOfHour() time.Time

func (*Now) EndOfMinute

func (now *Now) EndOfMinute() time.Time

func (*Now) EndOfMonth

func (now *Now) EndOfMonth() time.Time

func (*Now) EndOfQuarter

func (now *Now) EndOfQuarter() time.Time

func (*Now) EndOfSunday

func (now *Now) EndOfSunday() time.Time

func (*Now) EndOfWeek

func (now *Now) EndOfWeek() time.Time

func (*Now) EndOfYear

func (now *Now) EndOfYear() time.Time

func (*Now) Monday

func (now *Now) Monday() time.Time

func (*Now) MustParse

func (now *Now) MustParse(strs ...string) (t time.Time)

func (*Now) Parse

func (now *Now) Parse(strs ...string) (t time.Time, err error)

func (*Now) Sunday

func (now *Now) Sunday() time.Time

Jump to

Keyboard shortcuts

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