timex

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 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 MonthRangeWthiLocation added in v1.1.10

func MonthRangeWthiLocation(timeStamp int64, loc *time.Location) (int64, int64)

func Now

func Now() time.Duration

func ShanghaiZeroTime added in v1.1.10

func ShanghaiZeroTime(d time.Time) time.Time

func Since

func Since(d time.Duration) time.Duration

func ToTime

func ToTime(d time.Duration) time.Time

func UTCZeroTime added in v1.1.10

func UTCZeroTime(d time.Time) time.Time

func ZeroTime

func ZeroTime(d time.Time) time.Time

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

func ZeroTimeWithLocation added in v1.1.10

func ZeroTimeWithLocation(d time.Time, loc *time.Location) time.Time

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