Documentation ¶
Index ¶
- func BeginOfMonthWithDayOffset(monthOffset int, dayOffset int) time.Time
- func BeginningOfDayWithDayOffset(offset int) time.Time
- func BeginningOfMonthAgo() time.Time
- func BeginningOfMonthLater() time.Time
- func BeginningOfMonthWithMonthOffset(offset int) time.Time
- func Compare(a time.Time, b time.Time) int32
- func CurrentMonth() string
- func DayDurationWithDayOffset(offset int) (time.Time, time.Time)
- func Duration10Bit(hour int64, minute int64, second int64) float64
- func Duration13Bit(hour int64, minute int64, second int64) float64
- func DurationWithMillisecond(hour int64, minute int64, second int64) float64
- func DurationWithSecond(hour int64, minute int64, second int64) float64
- func EndOfDayWithDayOffset(offset int) time.Time
- func EndOfMonthAgo() time.Time
- func EndOfMonthLater() time.Time
- func EndOfMonthWithMonthOffset(offset int) time.Time
- func Gen10BitTimestamp() string
- func Gen10BitTs() int64
- func Gen13BitTimestamp() string
- func Gen13BitTs() int64
- func Gen19BitTimestamp() string
- func Gen19BitTs() int64
- func Is13BitTimestampValid(ts string, hour int64, minute int64, second int64) bool
- func Is13BitTsValid(ts int64, hour int64, minute int64, second int64) bool
- func IsAfter(a time.Time, b time.Time) bool
- func IsBefore(a time.Time, b time.Time) bool
- func IsEqual(a time.Time, b time.Time) bool
- func LastMonth() string
- func MonthAgoDuration() (time.Time, time.Time)
- func MonthAgoDurationTs() (int64, int64)
- func MonthDurationWithMonthOffset(offset int) (time.Time, time.Time)
- func MonthLaterDuration() (time.Time, time.Time)
- func MonthWithOffset(offset int) string
- func NextMonth() string
- func Today() string
- func TodayWithOffset(offset int) string
- func Tomorrow() string
- func Yesterday() string
- type Duration
- type NowEx
- func (now *NowEx) BeginningOfDayWithDayOffset(offset int) time.Time
- func (now *NowEx) BeginningOfMonthAgo() time.Time
- func (now *NowEx) BeginningOfMonthLater() time.Time
- func (now *NowEx) BeginningOfMonthWithMonthOffset(offset int) time.Time
- func (now *NowEx) EndOfDayWithDayOffset(offset int) time.Time
- func (now *NowEx) EndOfMonthAgo() time.Time
- func (now *NowEx) EndOfMonthLater() time.Time
- func (now *NowEx) EndOfMonthWithMonthOffset(offset int) time.Time
- type Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BeginOfMonthWithDayOffset ¶
基于 <月初1号> 偏移 N 天(+, -)
func BeginningOfDayWithDayOffset ¶
日初时刻: 当天+天偏移量(支持 +, - 偏移)
func BeginningOfMonthWithMonthOffset ¶
月初时刻: 当前月+月偏移量(支持 +, - 偏移)
func DayDurationWithDayOffset ¶
日区间: 偏移量(支持 +, - 偏移)
func Duration10Bit ¶
DurationWithSecond 别名
func Duration13Bit ¶
DurationWithSecond 别名
func DurationWithMillisecond ¶
时间段: 单位 毫秒 (千分之一秒)
func DurationWithSecond ¶
////////////////////////////////////////////////////////////////// 时间段: 单位 秒(s)
func EndOfDayWithDayOffset ¶
日末时刻: 当天+天偏移量(支持 +, - 偏移)
func EndOfMonthWithMonthOffset ¶
月末时刻: 当前月+月偏移量(支持 +, - 偏移)
func Is13BitTimestampValid ¶
时间戳是否过期:
func Is13BitTsValid ¶
时间戳是否过期:
func MonthDurationWithMonthOffset ¶
月份区间: 偏移量(支持 +, - 偏移)
Types ¶
type Duration ¶
Duration be used toml unmarshal string time, like 1s, 500ms. extend for toml parse.
func (Duration) Shrink ¶
Shrink will decrease the duration by comparing with context's timeout duration and return new timeout\context\CancelFunc.
func (*Duration) UnmarshalText ¶
UnmarshalText unmarshal text to duration.
type NowEx ¶
扩展:
func (*NowEx) BeginningOfDayWithDayOffset ¶
日初时刻: 当天+偏移量(支持 +, - 偏移)
func (*NowEx) BeginningOfMonthWithMonthOffset ¶
月初时刻: 当前月+偏移量(支持 +, - 偏移)
func (*NowEx) EndOfDayWithDayOffset ¶
日末时刻: 当天+偏移量(支持 +, - 偏移)