Documentation ¶
Index ¶
- Constants
- Variables
- func DateStrFormat(dateStr string) string
- func DateStrParse(dateStr string) time.Time
- func DateStrParses(year string, month string, day string) time.Time
- func FormatSeconds(value int) (hour, middle, seconds int)
- func GetFirstDateOfMonth(d time.Time) time.Time
- func GetLastDateOfMonth(d time.Time) time.Time
- func GetMonthOfTheDayStrs(d time.Time) (dayStrs []string)
- func GetWeekByDate(d time.Time) (week int)
- func GetWeekStart(d time.Time) time.Time
- func GetZeroTime(d time.Time) time.Time
- func TimeSubDay(beginTimeIf interface{}, endTimeIf interface{}) int
- type Date
- type Time
Constants ¶
View Source
const N = int(unsafe.Sizeof(0))
Variables ¶
View Source
var CustomizeHourLayout = "15:04:05"
View Source
var DetectorLayout = "20060102 15:04:05"
View Source
var Layout = "2006-01-02 15:04:05"
View Source
var LayoutBt = "2006-01-02T15:04:05"
View Source
var Loc, _ = time.LoadLocation("Local")
View Source
var SimplifyLayout = "2006-01-02"
Functions ¶
func DateStrFormat ¶
func DateStrParse ¶
func FormatSeconds ¶
FormatSeconds 格式化秒数为时、分、秒
func GetFirstDateOfMonth ¶
GetFirstDateOfMonth 获取传入的时间所在月份的第一天, 即某月第一天的0点。如传入time.Now(), 返回当前月份的第一天0点时间。
func GetLastDateOfMonth ¶
GetLastDateOfMonth 获取传入的时间所在月份的最后一天, 即某月最后一天的0点。如传入time.Now(), 返回当前月份的最后一天0点时间。
func GetMonthOfTheDayStrs ¶
GetMonthOfTheDayStrs 获取某一天所在月所有的天
func GetWeekByDate ¶
GetWeekByDate 获取传入时间所在一年当中的第几周(1-52)
func TimeSubDay ¶
func TimeSubDay(beginTimeIf interface{}, endTimeIf interface{}) int
TimeSubDay 获取两个时间相差的天数
Types ¶
type Date ¶
func (Date) MarshalJSON ¶
MarshalJSON on JSONTime format Time field with %Y-%m-%d
func (Date) UnmarshalJSON ¶
type Time ¶
Time format json timex field by myself
func (Time) MarshalJSON ¶
MarshalJSON on JSONTime format Time field with %Y-%m-%d %H:%M:%S
func (Time) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.