timer

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Zlib Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentMS

func CurrentMS() int64

CurrentMS 豪秒

func CurrentS

func CurrentS() int64

CurrentS 秒

func CurrentTime

func CurrentTime() string

func DateStringToTime

func DateStringToTime(d string) time.Time

DateStringToTime 日期字符串转换成时间 ("2006-01-02" to time.Time)

func DateTimeStringToTime

func DateTimeStringToTime(dt string) time.Time

DateTimeStringToTime 日期+时间字符串转换成时间 ("2006-01-02 15:04:05" to time.Time)

func Delay added in v0.6.6

func Delay(delay, tick time.Duration, fun TickerCallbackFunc, param interface{},
	funcDefer TickerCallbackFunc, paramDefer interface{})

func Get24Time

func Get24Time(t time.Time) time.Time

Get24Time 获取当日晚上24点(次日0点)的时间

func Get24TimeUnix

func Get24TimeUnix(t time.Time) int64

Get24TimeUnix 获取当日晚上24点(次日0点)的时间戳

func GetNowDateString

func GetNowDateString() string

GetNowDateString 获取当前时间的日期字符串("2006-01-02")

func GetNowString

func GetNowString() string

GetNowString 获取当前的时期+时间字符串

func GetTimeUnix

func GetTimeUnix(t time.Time) int64

GetTimeUnix 获取时间戳 return:1464059756

func GetToday24Time

func GetToday24Time() time.Time

GetToday24Time 获取今天晚上24点(次日0点)的时间

func GetToday24TimeUnix

func GetToday24TimeUnix() int64

GetToday24TimeUnix 获取今天晚上24点(次日0点)的时间戳

func IsWeekend

func IsWeekend(t time.Time) bool

IsWeekend 是否是周末

func Ticker added in v0.5.37

func Ticker(tick time.Duration, fun TickerCallbackFunc, param interface{},
	funcDefer TickerCallbackFunc, paramDefer interface{})

Ticker 定时调用

func TimeFormat added in v0.5.37

func TimeFormat(t time.Time) string

func TimeFormatNoLocal added in v0.5.37

func TimeFormatNoLocal(t time.Time) string

TimeFormatNoLocal 时间转换成日期+时间字符串 (time.Time to "2006-01-02 15:04:05")

func TimeToDate

func TimeToDate(t time.Time) string

TimeToDate 时间转换成日期字符串 (time.Time to "2006-01-02")

func TodayAt added in v0.4.6

func TodayAt(d time.Duration) time.Time

func TodayLast added in v0.4.6

func TodayLast() time.Time

TodayLast 今天最后时间 23:59:59

func TodayStringToTime

func TodayStringToTime(dt string) time.Time

TodayStringToTime 时间字符串转换成时间 ("15:04:05" to time.Time)

func UnixToFormat added in v0.5.37

func UnixToFormat(second int64) string

Types

type Expire added in v0.5.3

type Expire struct {
	StartIn  int64 `json:"startIn"`
	ExpireIn int64 `json:"expireIn"` //过期时间点
}

func NowExpireWithDuration added in v0.5.3

func NowExpireWithDuration(duration time.Duration) Expire

func NowExpireWithHour added in v0.5.3

func NowExpireWithHour(hourIn int64) Expire

func NowExpireWithMinute added in v0.5.4

func NowExpireWithMinute(minuteIn int64) Expire

func NowExpireWithSecond added in v0.5.3

func NowExpireWithSecond(secondIn int64) Expire

func (*Expire) IsDiff added in v0.5.3

func (e *Expire) IsDiff(diff int64) bool

func (*Expire) IsExpired added in v0.5.3

func (e *Expire) IsExpired() bool

type TickerCallbackFunc added in v0.5.37

type TickerCallbackFunc func(interface{}) bool

Jump to

Keyboard shortcuts

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