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" TimeLayout_1 = "2006-01-02 15:04:05.000" TimeLayout_2 = "20060102150405" DateLayout = "2006-01-02" )
Variables ¶
This section is empty.
Functions ¶
func DurationToUnit ¶ added in v1.0.11
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 GetRecentThirtyDay ¶ added in v1.0.14
func GetRecentThirtyDay() (thirtyDays []string)
获取最近 30天 日期
Types ¶
type Duration ¶ added in v1.0.8
Duration be used json unmarshal string time, like 1s, 500ms.
func (Duration) Shrink ¶ added in v1.0.11
Shrink will decrease the duration by comparing with context's timeout duration and return new timeout\context\CancelFunc.
func (*Duration) UnitTime ¶ added in v1.0.11
UnitTime duration parse to unit, such as "300ms", "1h30m" or "2h10s".
func (*Duration) UnmarshalText ¶ added in v1.0.8
UnmarshalText unmarshal text to duration.
Click to show internal directories.
Click to hide internal directories.