Documentation
¶
Index ¶
- func AddDays(t time.Time, days int) time.Time
- func AddHours(t time.Time, hours int) time.Time
- func AddMinutes(t time.Time, minutes int) time.Time
- func AddSeconds(t time.Time, seconds int) time.Time
- func CurrentDay() int
- func CurrentHour() int
- func CurrentMinute() int
- func CurrentMonth() time.Month
- func CurrentSecond() int
- func CurrentYear() int
- func EndOfDay(t time.Time) time.Time
- func EndOfMonth(t time.Time) time.Time
- func EndOfYear(t time.Time) time.Time
- func Format(t time.Time, layout string) string
- func FormatUnixMilli(ts int64, layout string) string
- func FormatUnixNano(ts int64, layout string) string
- func FormatUnixTimestamp(ts int64, layout string) string
- func FromUnixMilli(ts int64) time.Time
- func FromUnixNano(ts int64) time.Time
- func FromUnixTimestamp(ts int64) time.Time
- func IsAfter(t time.Time, date time.Time) bool
- func IsBefore(t time.Time, date time.Time) bool
- func IsSameDay(t1, t2 time.Time) bool
- func IsWeekday(t time.Time) bool
- func IsWeekend(t time.Time) bool
- func Parse(layout, value string) (time.Time, error)
- func Quarter(t time.Time) int
- func StartOfDay(t time.Time) time.Time
- func StartOfMonth(t time.Time) time.Time
- func StartOfYear(t time.Time) time.Time
- func TimeDiffInSeconds(t1, t2 time.Time) int64
- func UnixMilli() int64
- func UnixNano() int64
- func UnixTimestamp() int64
- func WeekdayName(t time.Time) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatUnixMilli ¶
FormatUnixMilli 将 Unix 毫秒时间戳转为指定格式字符串
func FormatUnixNano ¶
FormatUnixNano 将 Unix 纳秒时间戳转为指定格式字符串
func FormatUnixTimestamp ¶
FormatUnixTimestamp 将 Unix(秒) 时间戳转为指定格式字符串
func FromUnixTimestamp ¶
FromUnixTimestamp 将 Unix 时间戳转为 time.Time
func TimeDiffInSeconds ¶
TimeDiffInSeconds 获取两者时间差(秒)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.