Documentation ¶
Index ¶
- func DurationToUnit(duration time.Duration) string
- func FormatDate(dateStr string) (formatDate string)
- func FormatDateTime(timeStr string) (formatTime string)
- func GetCurMonthDays() (curMonthDays []string)
- func GetCurWeekDays() (curWeekDays []string)
- func GetLastMonthDays() (monthDays []string)
- func GetRecentSevenDay() (sevenDays []string)
- func GetRecentThirtyDay() (thirtyDays []string)
- func MonthDays(m time.Month, year int) int
- func ParseDate(timeStr string) (date time.Time)
- func ParseDateTime(timeStr string) (datetime time.Time)
- type Duration
- type Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DurationToUnit ¶
func FormatDate ¶
格式化Date成字符串
格式化前输入样式:2019-01-04T15:40:00Z 或 2019-01-04T15:40:00+08:00 格式化后返回样式:2019-01-04
func FormatDateTime ¶
格式化Datetime字符串
格式化前输入样式:2019-01-04T15:40:00Z 或 2019-01-04T15:40:00+08:00 格式化后返回样式:2019-01-04 15:40:00
Types ¶
type Duration ¶
Duration be used json unmarshal string time, like 1s, 500ms.
func (Duration) Shrink ¶
Shrink will decrease the duration by comparing with context's timeout duration and return new timeout\context\CancelFunc.
func (*Duration) UnmarshalText ¶
UnmarshalText unmarshal text to duration.
Click to show internal directories.
Click to hide internal directories.