Documentation ¶
Index ¶
- Constants
- 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 ¶
View Source
const ( TimeLayout = "2006-01-02 15:04:05" TimeLayout1 = "2006-01-02 15:04:05.000" TimeLayout2 = "20060102150405" DateLayout = "2006-01-02" )
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
func ParseDateTime ¶
解析时间 时间字符串格式:2006-01-02 15:04:05
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.