Documentation ¶
Index ¶
- Constants
- func CalcNextSec(sec int) int
- func CalcNextSecWithTime(t time.Time, sec int) int
- func Date(year int, month time.Month, day int) time.Time
- func DateWithHMS(year int, month time.Month, day, hour, min, sec int) time.Time
- func GetDeltaDay(t1, t2 time.Time) int
- func GetDeltaWeek(t1, t2 time.Time) int
- func GetHSMFromString(timeStr, layout string) (hour, min, sec int)
- func GetMondayZero(t time.Time) time.Time
- func GetMonthDays(t time.Time) int
- func GetNextDayInterval(t time.Time) time.Duration
- func GetSecond(d time.Duration) int
- func GetTimeFromString(timeStr, layout string) time.Time
- func GetToday(t time.Time) time.Time
- func IntervalFormat(time1, time2 time.Time) string
- func IntervalFormatSet(intervalType int, str string)
- func IsSameDay(t1, t2 time.Time) bool
- func IsSameHour(t1, t2 time.Time) bool
- func WeekDay(t time.Time) int
Constants ¶
View Source
const ( IntervalYear = iota IntervalDay IntervalHour IntervalMinute IntervalSecond IntervalNow )
View Source
const ( Nanosecond = time.Nanosecond Microsecond = time.Microsecond Millisecond = time.Millisecond Second = time.Second Minute = time.Minute Hour = time.Hour Day = time.Hour * 24 Week = Day * 7 )
Variables ¶
This section is empty.
Functions ¶
func CalcNextSecWithTime ¶
CalcNextSecWithTime 计算下一个N秒在多少秒之后
func DateWithHMS ¶ added in v0.0.2
DateWithHMS 返回一个精确到秒的时间
func GetDeltaWeek ¶ added in v0.0.2
GetDeltaWeek 获取两个时间需要加减的周数
func GetHSMFromString ¶ added in v0.0.2
GetHSMFromString 从时间字符串中获取时分秒
func GetNextDayInterval ¶
GetNextDayInterval 获取一个时间到下一天间隔多少秒
func GetTimeFromString ¶ added in v0.0.2
GetTimeFromString 将时间字符串转化为时间
func IntervalFormatSet ¶
IntervalFormatSet 针对 IntervalFormat 函数设置格式化内容
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.