timer

package
v1.22.4 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Zlib Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const FormatWMD = "Mon Jan 2 15:04:05 2006"
View Source
const FormatYMD = "2006-01-02 15:04:05"

Variables

This section is empty.

Functions

func Call added in v1.0.58

func Call(timeout time.Duration, task system.Task) (any, error)

Call 超时调用 Deprecated: please use system.Ctrl

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 func(any) bool, param any, funcDefer func(any) bool, paramDefer any)

Delay 超时调用 Deprecated: please use system.Ctrl

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 Hours added in v1.0.62

func Hours(hours int) time.Duration

func IsWeekend

func IsWeekend(t time.Time) bool

IsWeekend 是否是周末

func MillToFormat added in v1.4.9

func MillToFormat(msec int64) string

func Minutes added in v1.0.62

func Minutes(minutes int) time.Duration

func NowNano added in v1.0.58

func NowNano() int64

NowNano returns the current Unix time in nanoseconds.

func Seconds added in v1.0.62

func Seconds(seconds int) time.Duration

func Ticker added in v0.5.37

func Ticker(tick time.Duration, fun func(any) bool, param any, funcDefer func(any) bool, paramDefer any)

Ticker 定时调用 Deprecated: please use system.Ctrl

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"` //过期时间点
	// contains filtered or unexported fields
}

func NowExpireWithDuration added in v0.5.3

func NowExpireWithDuration(duration time.Duration) Expire

NowExpireWithDuration 秒

func NowExpireWithHour added in v0.5.3

func NowExpireWithHour(hourIn int64) Expire

func NowExpireWithMillSecond added in v1.8.53

func NowExpireWithMillSecond(msec 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 NowMillExpireWithDuration added in v1.8.53

func NowMillExpireWithDuration(duration time.Duration) Expire

NowMillExpireWithDuration 豪秒

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

Jump to

Keyboard shortcuts

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