Documentation ¶
Index ¶
- Constants
- func DaysBetweenTimestamps(timezone string, timestamp int64) (int, error)
- func GetCurDayHalfTimeFormat() string
- func GetCurDayHalfTimestamp() int64
- func GetCurDayZeroTimeFormat() string
- func GetCurDayZeroTimestamp() int64
- func GetCurrentTimeFormatted() string
- func GetCurrentTimestampByMill() int64
- func GetCurrentTimestampByNano() int64
- func GetCurrentTimestampBySecond() int64
- func GetTimeStampByFormat(datetime string) string
- func GetTimestampByTimezone(timezone string) (int64, error)
- func IsNthDayCycle(timezone string, startTimestamp int64, n int) (bool, error)
- func IsNthMonthCycle(timezone string, startTimestamp int64, n int) (bool, error)
- func IsNthWeekCycle(timezone string, startTimestamp int64, n int) (bool, error)
- func IsSameDayOfMonth(timezone string, timestamp int64) (bool, error)
- func IsSameWeekday(timezone string, timestamp int64) (bool, error)
- func IsWeekday(timestamp int64) bool
- func TimeStringFormatTimeUnix(timeFormat string, timeSrc string) int64
- func TimeStringToTime(timeString string) (time.Time, error)
- func TimeToString(t time.Time) string
- func UnixMillSecondToTime(millSecond int64) time.Time
- func UnixNanoSecondToTime(nanoSecond int64) time.Time
- func UnixSecondToTime(second int64) time.Time
Constants ¶
const ( TimeOffset = 8 * 3600 //8 hour offset HalfOffset = 12 * 3600 //Half-day hourly offset )
Variables ¶
This section is empty.
Functions ¶
func DaysBetweenTimestamps ¶ added in v1.1.0
func GetCurDayHalfTimeFormat ¶
func GetCurDayHalfTimeFormat() string
Get the formatted time at 12 o'clock of the day, the format is "2006-01-02_12-00-00"
func GetCurDayHalfTimestamp ¶
func GetCurDayHalfTimestamp() int64
Get the timestamp at 12 o'clock on the day
func GetCurDayZeroTimeFormat ¶
func GetCurDayZeroTimeFormat() string
Get the formatted time at 0 o'clock of the day, the format is "2006-01-02_00-00-00"
func GetCurDayZeroTimestamp ¶
func GetCurDayZeroTimestamp() int64
Get the timestamp at 0 o'clock of the day
func GetCurrentTimeFormatted ¶
func GetCurrentTimeFormatted() string
func GetCurrentTimestampByMill ¶
func GetCurrentTimestampByMill() int64
Get the current timestamp by Mill
func GetCurrentTimestampByNano ¶
func GetCurrentTimestampByNano() int64
Get the current timestamp by Nano
func GetCurrentTimestampBySecond ¶
func GetCurrentTimestampBySecond() int64
Get the current timestamp by Second
func GetTimeStampByFormat ¶
GetTimeStampByFormat convert string to unix timestamp
func GetTimestampByTimezone ¶ added in v1.1.0
GetTimestampByTimezone get specific timestamp by timezone
func IsNthDayCycle ¶ added in v1.1.0
func IsNthMonthCycle ¶ added in v1.1.0
IsNthMonthCycle checks if the current day is part of an N-month cycle starting from a given start timestamp.
func IsNthWeekCycle ¶ added in v1.1.0
IsNthWeekCycle checks if the current day is part of an N-week cycle starting from a given start timestamp.
func IsSameDayOfMonth ¶ added in v1.1.0
func IsSameWeekday ¶ added in v1.1.0
IsSameWeekday judge current day and specific day is the same of a week.
func TimeStringFormatTimeUnix ¶
TimeStringFormatTimeUnix convert string to unix timestamp
func TimeStringToTime ¶
TimeStringToTime convert string to time.Time
func UnixMillSecondToTime ¶
UnixMillSecondToTime convert millSecond to time.Time type
func UnixNanoSecondToTime ¶
Convert nano timestamp to time.Time type
func UnixSecondToTime ¶
Convert timestamp to time.Time type
Types ¶
This section is empty.