Documentation ¶
Index ¶
- Constants
- func FormatMilliDate(milliseconds int64) string
- func FormatMilliDateTime(milliseconds int64) string
- func FormatUnixDate(timestamp int64) string
- func FormatUnixDateTime(timestamp int64) string
- func IsLeap(year int) bool
- type Time
- func (t *Time) BeginOfDay() *Time
- func (t *Time) BeginOfHour() *Time
- func (t *Time) BeginOfMinute() *Time
- func (t *Time) BeginOfMonth() *Time
- func (t *Time) BeginOfWeek() *Time
- func (t *Time) BeginOfYear() *Time
- func (t *Time) CurrentMilliTime() int64
- func (t *Time) CurrentNanoTime() int64
- func (t *Time) CurrentUnixTime() int64
- func (t *Time) EndOfDay() *Time
- func (t *Time) EndOfHour() *Time
- func (t *Time) EndOfMinute() *Time
- func (t *Time) EndOfMonth() *Time
- func (t *Time) EndOfWeek() *Time
- func (t *Time) EndOfYear() *Time
- func (t *Time) Format(layout string) string
- func (t *Time) Leap() bool
Constants ¶
const ( DateFormat = "2006-01-02" DateTimeFormat = "2006-01-02 15:04:05" )
Variables ¶
This section is empty.
Functions ¶
func FormatMilliDate ¶ added in v1.0.0
FormatMilliDate formats Unix timestamp (ms) to date string
func FormatMilliDateTime ¶ added in v1.0.0
FormatMilliDateTime formats Unix timestamp (ms) to time string.
func FormatUnixDate ¶ added in v1.0.0
FormatUnixDate formats Unix timestamp (s) to date string
func FormatUnixDateTime ¶ added in v1.0.0
FormatUnixDateTime formats Unix timestamp (s) to time string.
Types ¶
type Time ¶ added in v1.0.0
func (*Time) BeginOfDay ¶ added in v1.0.0
BeginOfDay return begin time of current day
func (*Time) BeginOfHour ¶ added in v1.0.0
BeginOfHour return begin time of current hour
func (*Time) BeginOfMinute ¶ added in v1.0.0
BeginOfMinute return begin second of current minute
func (*Time) BeginOfMonth ¶ added in v1.0.0
BeginOfMonth return begin day time of current month
func (*Time) BeginOfWeek ¶ added in v1.0.0
BeginOfWeek return begin day time of current week NOTE: week begin from Sunday
func (*Time) BeginOfYear ¶ added in v1.0.0
BeginOfYear return the beginning time of current year
func (*Time) CurrentMilliTime ¶ added in v1.0.0
GetCurrentMilliTime return current milliseconds
func (*Time) CurrentNanoTime ¶ added in v1.0.0
GetCurrentNanoTime return current nano seconds
func (*Time) CurrentUnixTime ¶ added in v1.0.0
GetCurrentUnixTime return current unix seconds
func (*Time) EndOfMinute ¶ added in v1.0.0
EndOfMinute return end second of current minute
func (*Time) EndOfMonth ¶ added in v1.0.0
EndOfMonth return end day time of current month
func (*Time) EndOfWeek ¶ added in v1.0.0
EndOfWeek return end day time of current week NOTE: week end with Saturday