Documentation
¶
Overview ¶
精确到s的时间范围计算
Index ¶
- Constants
- func DayFirst(time Time.Time) uint64
- func DayLast(time Time.Time) uint64
- func FirstAndLastDay(time Time.Time) (uint64, uint64)
- func FirstAndLastHour(time Time.Time) (uint64, uint64)
- func FirstAndLastMinute(time Time.Time) (uint64, uint64)
- func FirstAndLastMonth(time Time.Time) (uint64, uint64)
- func FirstAndLastWeek(time Time.Time) (uint64, uint64)
- func FirstAndLastYear(time Time.Time) (uint64, uint64)
- func HourFirst(time Time.Time) uint64
- func HourLast(time Time.Time) uint64
- func MinuteFirst(time Time.Time) uint64
- func MinuteLast(time Time.Time) uint64
- func MonthDays(time Time.Time) uint
- func MonthFirst(time Time.Time) uint64
- func MonthLast(time Time.Time) uint64
- func WeekFirst(time Time.Time) uint64
- func WeekLast(time Time.Time) uint64
- func YearDays(time Time.Time) uint
- func YearFirst(time Time.Time) uint64
- func YearLast(time Time.Time) uint64
- type Duration
- type RecordItem
- type TimeSlice
Constants ¶
View Source
const ( DATETIME_FORMATTER = "2006-01-02 15:04:05" DATETIME_FORMATTER_Mill = "2006-01-02 15:04:05.000" DATETIME_TIMEZONE_FORMATTER = "2006-01-02 15:04:05 -0700" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RecordItem ¶
type TimeSlice ¶
func SplitDuration ¶
按指定时间间隔 进行1个自然周期的切割
参数
- start: 开始时间
- end: 结束时间
- duration: 时间间隔周期
返回值
- []*TimeSlice: 切割后的时间片段
func SplitNaturalDuration ¶
按指定时间间隔 进行自然周期的切割
参数
- start: 开始时间
- end: 结束时间
- unit: 间隔数量, 时间间隔等于 unit * duration
- duration: 时间间隔周期
返回值
- []*TimeSlice: 切割后的时间片段
Click to show internal directories.
Click to hide internal directories.