Documentation ¶
Index ¶
- Constants
- func GetFirstDayOfWeek(offsetWeeks ...int) time.Time
- func GetFirstSecondOfDay(offsetDays ...int) time.Time
- func GetLastDayOfWeek(offsetWeeks ...int) time.Time
- func GetLastSecondOfDay(offsetDays ...int) time.Time
- func Now() time.Time
- func Today() time.Time
- func Tomorrow() time.Time
- func Transform(t time.Time, rule ...[]TransformRule) string
- func Unix(sec, nsec int64) time.Time
- func UnixMicro(usec int64) time.Time
- func UnixMilli(msec int64) time.Time
- func UnixNano(nsec int64) time.Time
- func Yesterday() time.Time
- type TransformRule
Constants ¶
View Source
const ( TimeLayout = "15:04:05" DateLayout = "2006-01-02" DatetimeLayout = "2006-01-02 15:04:05" TimeFormat = "H:i:s" DateFormat = "Y-m-d" DatetimeFormat = "Y-m-d H:i:s" )
Variables ¶
This section is empty.
Functions ¶
func GetFirstDayOfWeek ¶
GetFirstDayOfWeek 获取一周中的第一天 offsetWeeks 偏移周数,例如:-1:上一周 0:本周 1:下一周
func GetFirstSecondOfDay ¶
GetFirstSecondOfDay 获取一天中的第一秒 offsetDays 偏移天数,例如:-1:前一天 0:当前 1:明天
func GetLastDayOfWeek ¶
GetLastDayOfWeek 获取一周中的最后一天 offsetWeeks 偏移周数,例如:-1:上一周 0:本周 1:下一周
func GetLastSecondOfDay ¶
GetLastSecondOfDay 获取一天中的最后一秒 offsetDays 偏移天数,例如:-1:前一天 0:当前 1:明天
Types ¶
type TransformRule ¶
Click to show internal directories.
Click to hide internal directories.