Documentation ¶
Index ¶
- func Date(t time.Time, location ...*time.Location) string
- func DateTime(t time.Time, location ...*time.Location) string
- func DoCycleTask(ctx context.Context, f func(), d time.Duration)
- func Format(t time.Time, layout string, location ...*time.Location) string
- func HongKong() *time.Location
- func Local() *time.Location
- func Location(name string) *time.Location
- func Now(location ...*time.Location) time.Time
- func NowAdd(d time.Duration, location ...*time.Location) time.Time
- func NowAddDate(d time.Duration, location ...*time.Location) string
- func NowAddDateTime(d time.Duration, location ...*time.Location) string
- func NowAddFormat(d time.Duration, layout string, location ...*time.Location) string
- func NowAddUnixMicrosecond(d time.Duration, location ...*time.Location) int64
- func NowAddUnixMillisecond(d time.Duration, location ...*time.Location) int64
- func NowAddUnixNanosecond(d time.Duration, location ...*time.Location) int64
- func NowAddUnixSecond(d time.Duration, location ...*time.Location) int64
- func NowDate(location ...*time.Location) string
- func NowDateTime(location ...*time.Location) string
- func NowFormat(layout string, location ...*time.Location) string
- func NowUnixMicrosecond(location ...*time.Location) int64
- func NowUnixMillisecond(location ...*time.Location) int64
- func NowUnixNanosecond(location ...*time.Location) int64
- func NowUnixSecond(location ...*time.Location) int64
- func Shanghai() *time.Location
- func SleepMicrosecond(n int64)
- func SleepMillisecond(n int64)
- func SleepSecond(n int64)
- func StringToTime(str, layout string, location ...*time.Location) (time.Time, error)
- func StringToUnix(str, layout string, location ...*time.Location) int64
- func UTC() *time.Location
- func UnixAddDate(timestamp int64, years, months, days int, location ...*time.Location) time.Time
- func UnixAddDays(timestamp int64, days int, location ...*time.Location) time.Time
- func UnixAddMonths(timestamp int64, months int, location ...*time.Location) time.Time
- func UnixAddYears(timestamp int64, years int, location ...*time.Location) time.Time
- func UnixAfter(timestamp1, timestamp2 int64) bool
- func UnixBefore(timestamp1, timestamp2 int64) bool
- func UnixDifferDays(timestamp1, timestamp2 int64) int
- func UnixDifferHours(timestamp1, timestamp2 int64) float64
- func UnixEqual(timestamp1, timestamp2 int64) bool
- func UnixMicrosecond(t time.Time, location ...*time.Location) int64
- func UnixMillisecond(t time.Time, location ...*time.Location) int64
- func UnixNanosecond(t time.Time, location ...*time.Location) int64
- func UnixSecond(t time.Time, location ...*time.Location) int64
- func UnixToTime(timestamp int64, location ...*time.Location) time.Time
- func UnixTodayRange(location ...*time.Location) (int64, int64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoCycleTask ¶
DoCycleTask processing the cycle task with a period specified by the duration.
func Format ¶
Format returns a textual representation of the time value t formatted according to layout.
func NowAddDate ¶
NowAddDate returns a date representation of now added time value.
func NowAddDateTime ¶
NowAddDateTime returns a datetime representation of now added time value.
func NowAddFormat ¶
NowAddFormat returns a textual representation of now added time value formatted according to layout.
func NowAddUnixMicrosecond ¶
NowAddUnixMicrosecond returns now added unix microsecond timestamp.
func NowAddUnixMillisecond ¶
NowAddUnixMillisecond returns now added unix millisecond timestamp.
func NowAddUnixNanosecond ¶
NowAddUnixNanosecond returns now added unix nanosecond timestamp.
func NowAddUnixSecond ¶
NowAddUnixSecond returns now added unix second timestamp.
func NowDateTime ¶
NowDateTime returns a datetime representation of now time value.
func NowFormat ¶
NowFormat returns a textual representation of now time value formatted according to layout.
func NowUnixMicrosecond ¶
NowUnixMicrosecond returns now unix microsecond timestamp.
func NowUnixMillisecond ¶
NowUnixMillisecond returns now unix millisecond timestamp.
func NowUnixNanosecond ¶
NowUnixNanosecond returns now unix nanosecond timestamp.
func NowUnixSecond ¶
NowUnixSecond returns now unix second timestamp.
func SleepMicrosecond ¶
func SleepMicrosecond(n int64)
SleepMicrosecond pauses the current goroutine for at least n microsecond.
func SleepMillisecond ¶
func SleepMillisecond(n int64)
SleepMillisecond pauses the current goroutine for at least n millisecond.
func SleepSecond ¶
func SleepSecond(n int64)
SleepSecond pauses the current goroutine for at least n second.
func StringToTime ¶
StringToTime returns time.Time representation of str value parsed according to layout. layout example:
20060102150405 2006-01-02 15:04:05 2006/01/02 15/04/05
func StringToUnix ¶
StringToUnix returns unix second timestamp representation of str value parsed according to layout. If str parsed err, it returns now unix second timestamp. layout example:
20060102150405 2006-01-02 15:04:05 2006/01/02 15/04/05
func UnixAddDate ¶
UnixAddDate returns time.Time after unix timestamp has been added date.
func UnixAddDays ¶
UnixAddDays returns time.Time after unix timestamp has been added days.
func UnixAddMonths ¶
UnixAddMonths returns time.Time after unix timestamp has been added months.
func UnixAddYears ¶
UnixAddYears returns time.Time after unix timestamp has been added years.
func UnixBefore ¶
UnixBefore reports whether timestamp1 is before timestamp2.
func UnixDifferDays ¶
UnixDifferDays returns the number of days between two timestamp.
func UnixDifferHours ¶
UnixDifferHours returns the number of hours between two timestamp.
func UnixMicrosecond ¶
UnixMicrosecond returns t as unix microsecond timestamp.
func UnixMillisecond ¶
UnixMillisecond returns t as unix millisecond timestamp.
func UnixNanosecond ¶
UnixNanosecond returns t as unix nanosecond timestamp.
func UnixSecond ¶
UnixSecond returns t as unix second timestamp.
func UnixToTime ¶
UnixToTime returns time.Time by unix timestamp.
Types ¶
This section is empty.