timex

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeLayout = "2006-01-02 15:04:05"
	DateLayout = "2006-01-02"
)

Variables

This section is empty.

Functions

func MonthRange

func MonthRange(timeStamp int64) (int64, int64)

@desc 返回一个月的开始时间和结束时间 @auth liuguoqiang 2020-04-27 @param @return

func Now

func Now() time.Duration

func Since

func Since(d time.Duration) time.Duration

func ToTime

func ToTime(d time.Duration) time.Time

func ZeroTime

func ZeroTime(d time.Time) time.Time

@desc 获取某一天的0点时间 @auth liuguoqiang 2020-04-27 @param @return

Types

type FakeTicker

type FakeTicker interface {
	Ticker
	Done()
	Tick()
	Wait(d time.Duration) error
}

func NewFakeTicker

func NewFakeTicker() FakeTicker

type Ticker

type Ticker interface {
	Chan() <-chan time.Time
	Stop()
}

func NewRealTicker

func NewRealTicker(d time.Duration) Ticker

type Time

type Time time.Time

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

func (*Time) Scan

func (t *Time) Scan(v interface{}) error

func (Time) String

func (t Time) String() string

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) (err error)

func (Time) Value

func (t Time) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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