Documentation ¶
Index ¶
- Constants
- func After(d time.Duration) <-chan time.Time
- func CurrentTimeMillis() uint64
- func CurrentTimeMillsWithTicker() uint64
- func CurrentTimeNano() uint64
- func Duration(str string) time.Duration
- func Elapse(f func()) int64
- func FormatDate(tsMillis uint64) string
- func FormatTimeMillis(tsMillis uint64) string
- func GetTimestampInMilli() int64
- func IsLeapYear(year int) bool
- func NewRashTimer(tick time.Duration) *rashTimer
- func Sleep(d time.Duration)
- func StartTimeTicker()
- func Tick(d time.Duration) <-chan time.Time
- type Ticker
- type Time
- func (t *Time) BeginOfDay() *Time
- func (t *Time) BeginOfHour() *Time
- func (t *Time) BeginOfMinute() *Time
- func (t *Time) BeginOfMonth() *Time
- func (t *Time) BeginOfWeek() *Time
- func (t *Time) BeginOfYear() *Time
- func (t *Time) EndOfDay() *Time
- func (t *Time) EndOfHour() *Time
- func (t *Time) EndOfMinute() *Time
- func (t *Time) EndOfMonth() *Time
- func (t *Time) EndOfWeek() *Time
- func (t *Time) EndOfYear() *Time
- type TimeFormat
- type Timer
Constants ¶
const ( DateFormat = "2006-01-02" UnixTimeUnitOffset = uint64(time.Millisecond / time.Nanosecond) )
Variables ¶
This section is empty.
Functions ¶
func CurrentTimeMillis ¶
func CurrentTimeMillis() uint64
CurrentTimeMillis @Description: 当前时间的时间戳(毫秒) @return uint64
func CurrentTimeMillsWithTicker ¶
func CurrentTimeMillsWithTicker() uint64
CurrentTimeMillsWithTicker @Description: 当前时间的定时器 @return uint64
func CurrentTimeNano ¶
func CurrentTimeNano() uint64
CurrentTimeNano @Description: 当前时间的nanoseconds @return uint64
func FormatDate ¶
FormatDate @Description: 格式化时间戳(毫秒)为字符串日期格式 @param tsMillis @return string
func FormatTimeMillis ¶
FormatTimeMillis @Description: 格式化时间戳(毫秒)为字符串时间格式 @param tsMillis @return string
func GetTimestampInMilli ¶
func GetTimestampInMilli() int64
GetTimestampInMilli @Description: @return int64
func IsLeapYear ¶
IsLeapYear @Description: 是否是闰年 @param year @return bool
func NewRashTimer ¶
NewRashTimer is the time for a jiffies
Types ¶
type Ticker ¶
Ticker @Description: 定时器
type Time ¶
Time @Description: 时间
func (*Time) BeginOfDay ¶
BeginOfDay @Description: 此时间天的开始时间 @receiver t @return *Time
func (*Time) BeginOfHour ¶
BeginOfHour @Description: 此时间小时的开始时间 @receiver t @return *Time
func (*Time) BeginOfMinute ¶
BeginOfMinute @Description: 此时间分钟的开始时间 @receiver t @return *Time
func (*Time) BeginOfMonth ¶
BeginOfMonth @Description: 此时间年的开始月份 @receiver t @return *Time
func (*Time) BeginOfWeek ¶
BeginOfWeek @Description: 此时间周的开始时间,注意:一周的开始日期是星期日 @receiver t @return *Time
func (*Time) BeginOfYear ¶
BeginOfYear @Description: 此时间年的开始时间 @receiver t @return *Time
func (*Time) EndOfMinute ¶
EndOfMinute @Description: 此时间分钟的结束时间 @receiver t @return *Time
func (*Time) EndOfMonth ¶
EndOfMonth @Description: 此时间年的结束月份 @receiver t @return *Time