Documentation ¶
Index ¶
- Constants
- func DateTimeToTimestamp(datetime string) (int64, error)
- func GetDateListByTime(t time.Time, layout string, dayNum int, desc bool) []string
- func GetMonthListByTime(t time.Time, layout string, monthNum int, desc bool) []string
- func IsTodayByTimestamp(timestamp int64) bool
- func TimestampFormat(timestamp int64, layout string) string
- func TimestampToDatetime(timestamp int64) string
- func ToTimestamp(datetime string, layout string) (int64, error)
Constants ¶
View Source
const ( Layout = "01/02 03:04:05PM '06 -0700" // The reference time, in numerical order. ANSIC = "Mon Jan _2 15:04:05 2006" UnixDate = "Mon Jan _2 15:04:05 MST 2006" RubyDate = "Mon Jan 02 15:04:05 -0700 2006" RFC822 = "02 Jan 06 15:04 MST" RFC822Z = "02 Jan 06 15:04 -0700" // RFC822 with numeric zone RFC850 = "Monday, 02-Jan-06 15:04:05 MST" RFC1123 = "Mon, 02 Jan 2006 15:04:05 MST" RFC1123Z = "Mon, 02 Jan 2006 15:04:05 -0700" // RFC1123 with numeric zone RFC3339 = "2006-01-02T15:04:05Z07:00" RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00" Kitchen = "3:04PM" // Handy time stamps. Stamp = "Jan _2 15:04:05" StampMilli = "Jan _2 15:04:05.000" StampMicro = "Jan _2 15:04:05.000000" StampNano = "Jan _2 15:04:05.000000000" DateTime = "2006-01-02 15:04:05" DateOnly = "2006-01-02" TimeOnly = "15:04:05" // zero DateOnlyWithHZero = "2006-01-02 00:00:00" DateOnlyWithMZero = "2006-01-02 15:00:00" DateOnlyWithSZero = "2006-01-02 15:04:00" // last time DateLastTime = "2006-01-02 23:59:59" YearAndMonth = "2006-01" )
Variables ¶
This section is empty.
Functions ¶
func DateTimeToTimestamp ¶
DateTimeToTimestamp datetime转timestamp
func GetDateListByTime ¶
func GetMonthListByTime ¶
func IsTodayByTimestamp ¶
func TimestampFormat ¶
TimestampFormat timestamp格式化
func TimestampToDatetime ¶
TimestampToDatetime timestamp转datetime
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.