Documentation ¶
Index ¶
- func AddDay(t time.Time, day int64) time.Time
- func AddHour(t time.Time, hour int64) time.Time
- func AddMinute(t time.Time, minute int64) time.Time
- func AddYear(t time.Time, year int64) time.Time
- func BeginOfDay(t time.Time) time.Time
- func BeginOfHour(t time.Time) time.Time
- func BeginOfMinute(t time.Time) time.Time
- func BeginOfMonth(t time.Time) time.Time
- func BeginOfWeek(t time.Time) time.Time
- func BeginOfYear(t time.Time) time.Time
- func BetweenSeconds(t1 time.Time, t2 time.Time) int64
- func DayOfYear(t time.Time) int
- func EndOfDay(t time.Time) time.Time
- func EndOfHour(t time.Time) time.Time
- func EndOfMinute(t time.Time) time.Time
- func EndOfMonth(t time.Time) time.Time
- func EndOfWeek(t time.Time) time.Time
- func EndOfYear(t time.Time) time.Time
- func FormatStrToTime(str, format string, timezone ...string) (time.Time, error)
- func FormatTimeToStr(t time.Time, format string, timezone ...string) string
- func GetNightTimestamp() int64
- func GetNowDate() string
- func GetNowDateTime() string
- func GetNowTime() string
- func GetZeroHourTimestamp() int64
- func IsLeapYear(year int) bool
- func IsWeekend(t time.Time) bool
- func NewFormat(t string) (*theTime, error)
- func NewISO8601(iso8601 string) (*theTime, error)
- func NewUnix(unix int64) *theTime
- func NewUnixNow() *theTime
- func NowDateOrTime(format string, timezone ...string) string
- func Timestamp(timezone ...string) int64
- func TimestampMicro(timezone ...string) int64
- func TimestampMilli(timezone ...string) int64
- func TimestampNano(timezone ...string) int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BeginOfDay ¶ added in v1.2.4
BeginOfDay return beginning hour time of day
func BeginOfHour ¶ added in v1.2.4
BeginOfHour return beginning hour time of day
func BeginOfMinute ¶ added in v1.2.4
BeginOfMinute return beginning minute time of day
func BeginOfMonth ¶ added in v1.2.4
BeginOfMonth return beginning of month
func BeginOfWeek ¶ added in v1.2.4
BeginOfWeek return beginning week, week begin from Sunday
func BeginOfYear ¶ added in v1.2.4
BeginOfYear return beginning of year
func BetweenSeconds ¶ added in v1.3.9
BetweenSeconds returns the number of seconds between two times.
func EndOfMinute ¶ added in v1.2.4
EndOfMinute return end minute time of day
func EndOfMonth ¶ added in v1.2.4
EndOfMonth return end of month
func FormatStrToTime ¶
FormatStrToTime convert string to time
func FormatTimeToStr ¶
FormatTimeToStr convert time to string
func GetNightTimestamp ¶
func GetNightTimestamp() int64
GetNightTimestamp return timestamp of zero hour (timestamp of 23:59)
func GetNowDateTime ¶
func GetNowDateTime() string
GetNowDateTime return format yyyy-mm-dd hh-mm-ss of current datetime
func GetZeroHourTimestamp ¶
func GetZeroHourTimestamp() int64
GetZeroHourTimestamp return timestamp of zero hour (timestamp of 00:00)
func IsLeapYear ¶ added in v1.3.9
IsLeapYear check if param year is leap year or not.
func NewFormat ¶ added in v1.2.7
NewFormat return unix timestamp of specified time string, t should be "yyyy-mm-dd hh:mm:ss"
func NewISO8601 ¶ added in v1.2.7
NewISO8601 return unix timestamp of specified iso8601 time string
func NewUnix ¶ added in v1.2.7
func NewUnix(unix int64) *theTime
NewUnix return unix timestamp of specified time
func NewUnixNow ¶ added in v1.2.7
func NewUnixNow() *theTime
NewUnixNow return unix timestamp of current time
func NowDateOrTime ¶ added in v1.4.1
NowDateOrTime return current datetime with specific format and timezone.
func TimestampMicro ¶ added in v1.4.1
TimestampMicro return current micro second timestamp.
func TimestampMilli ¶ added in v1.4.1
TimestampMilli return current mill second timestamp.
func TimestampNano ¶ added in v1.4.1
TimestampNano return current nano second timestamp.
Types ¶
This section is empty.