Documentation ¶
Index ¶
- Variables
- func BeginOfDay(beginDate time.Time) time.Time
- func BeginOfMonth(beginDate time.Time) time.Time
- func Between(beginDate time.Time, endDate time.Time, unit string) int
- func EndOfDay(beginDate time.Time) time.Time
- func EndOfMonth(beginDate time.Time) time.Time
- func Format(dateTime time.Time, format string) string
- func FormatInLocation(dateTime time.Time, format string, name string) string
- func FormatNow(format string) string
- func LastMonth() time.Time
- func LastWeek() time.Time
- func LastYear() time.Time
- func NextMonth() time.Time
- func NextWeek() time.Time
- func NextYear() time.Time
- func Now() string
- func NowTimeNoSeparate() string
- func Parse(dateTime string) time.Time
- func ParseUTCFormatTZ(dateTime string) string
- func Today() string
- func Tomorrow() time.Time
- func Yesterday() time.Time
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Ms = "MS" Seconds = "SECOND" Minutes = "MINUTE" Hours = "HOUR" Days = "DAY" )
Functions ¶
func BeginOfMonth ¶ added in v0.1.2
BeginOfMonth 获取某月的开始时间
func Between ¶ added in v0.0.8
Between 判断两个日期相差的时长,只保留绝对值 @param beginDate 起始日期 @param endDate 结束日期 @param unit 相差的单位 @return 日期差
func EndOfMonth ¶ added in v0.1.2
EndOfMonth 获取某月的结束时间
func Format ¶ added in v0.0.3
Format 格式化日期 @param dateTime 日期 @param format 日期格式:支持yyyy-MM-dd HH:mm:ss @return 格式化后的日期
func FormatInLocation ¶ added in v0.0.9
FormatInLocation 格式化时区日期 @param dateTime 日期 @param format 日期格式:支持yyyy-MM-dd HH:mm:ss @param name 时区:如 Asia/Shanghai @return 格式化后的日期
func FormatNow ¶ added in v0.0.3
FormatNow 格式化当前时间 @param format 日期格式:支持yyyy-MM-dd HH:mm:ss @return 格式化后的当前时间
func NowTimeNoSeparate ¶ added in v0.0.3
func NowTimeNoSeparate() string
NowTimeNoSeparate 没有-的当前时间 yyyyMMddHHmmss @return 没有-的当前时间
func ParseUTCFormatTZ ¶ added in v0.1.2
ParseUTCFormatTZ 时间日期字符串转UTC日期 @param dateTime 日期字符串 @return 日期
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.