Documentation ¶
Index ¶
- Constants
- Variables
- func AvgTime(items []time.Duration) time.Duration
- func BytesFormat(bytes uint64) string
- func CheckCrossDay(baset time.Time, now time.Time) bool
- func CheckCrossMonth(baset time.Time, now time.Time) bool
- func CheckCrossWeek(baset time.Time, now time.Time) bool
- func CurrentMS() int64
- func CurrentTime() time.Time
- func DeltaDays(unix1, unix2 int64) int64
- func GetDayInMon(year int, mon int) int
- func MillisTime() int64
- func Nanos2Time(ns int64) time.Time
- func NanosTime() int64
- func NextHour(tm time.Time) time.Time
- func NextHours(tm time.Time, n int) time.Time
- func NextMidnight(tm time.Time, day int) time.Time
- func NextSundayMS(tm time.Time) time.Time
- func NowToSharpClock(tm time.Time) time.Duration
- func ResetTime(t int64)
- func S2UnixTime(value string, loc *time.Location) (*time.Time, error)
- func Second2Time(second int64) time.Time
- func SecondTime() int64
- func SharpClock(tm time.Time) time.Time
- func ShortTimeFormat(d time.Duration) string
- func Time2Midnight(tm time.Time) time.Time
- func TimeMillis(t time.Duration) int64
- func TimeSecond(t time.Duration) int64
Constants ¶
View Source
const ( //MILLISECONDS_OF_DAY 一天的毫秒数 MILLISECONDS_OF_DAY = 24 * MILLISECONDS_OF_HOUR //MILLISECONDS_OF_HOUR 一小时的毫秒数 MILLISECONDS_OF_HOUR = 60 * MILLISECONDS_OF_MINUTE //MILLISECONDS_OF_MINUTE 一分钟的毫秒数 MILLISECONDS_OF_MINUTE = 60 * MILLISECONDS_OF_SECOND //MILLISECONDS_OF_SECOND 一秒的毫秒数 MILLISECONDS_OF_SECOND = 1000 )
Variables ¶
Functions ¶
func CheckCrossMonth ¶
CheckCrossMonth 检查是否跨月
func CheckCrossWeek ¶
CheckCrossWeek 检查是否跨周
func Nanos2Time ¶
Nanos2Time 纳秒时间转成服务器时间(根据传入的时间的时区在返回的时间上进行时区纠正time.Time().In(tm.Location()))
func NextMidnight ¶
NextMidnight 获取一个时间点的 x日后的凌晨时间
func NextSundayMS ¶
NextSundayMS 获取指定时间的下一个周末时间,自己处理好时区的问题,周一凌晨作为跨周,如果传入的时间没有超过周一凌晨,则返回周一凌晨的时间点,否则返回下一周的周一凌晨
func S2UnixTime ¶
S2UnixTime date format: "2006-01-02 13:04:00"
func Second2Time ¶
Second2Time 秒时间转成服务器时间(根据传入的时间的时区在返回的时间上进行时区纠正time.Time().In(tm.Location()))
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.