btime

package
v0.2.32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2026 License: AGPL-3.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CurTimeMS    = int64(0)
	UTCLocale, _ = time.LoadLocation("UTC")
	LocShow      *time.Location // 用于显示的时区
)

Functions

func MSToTime

func MSToTime(timeMSecs int64) *time.Time

func Now

func Now() *time.Time

func ParseTimeMS

func ParseTimeMS(timeStr string) (int64, error)

ParseTimeMS Convert time string to 13-digit millisecond timestamp Supported forms: 将时间字符串转为13位毫秒时间戳 支持的形式: 2006 200601 20060102 2006-01-02 10-digit timestamp 13-digit timestamp 2006-01-02 15:04 2006-01-02 15:04:05

func ParseTimeMSBy

func ParseTimeMSBy(layout, timeStr string) (int64, error)

func Time

func Time() float64

Time Get the current 10-digit second-level timestamp 获取当前10位秒级时间戳

func TimeMS

func TimeMS() int64

TimeMS Get the current 13-digit millisecond timestamp 获取当前13位毫秒时间戳

func ToDateStr

func ToDateStr(timestamp int64, format string) string

ToDateStr Convert timestamp to time string 将时间戳转为时间字符串 format default: 2006-01-02 15:04:05

func ToDateStrLoc

func ToDateStrLoc(timestamp int64, format string) string

func ToTime

func ToTime(timestamp int64) time.Time

func UTCStamp

func UTCStamp() int64

UTCStamp Get 13-digit millisecond timestamp 获取13位毫秒时间戳

func UTCTime

func UTCTime() float64

UTCTime Get 10-digit second-level floating point number 获取10位秒级浮点数

Types

type RetryWaits added in v0.2.16

type RetryWaits struct {
	// contains filtered or unexported fields
}

func NewRetryWaits added in v0.2.16

func NewRetryWaits(rate float64, waits []int64) *RetryWaits

NewRetryWaits waits is array of sleep milliseconds while fail

func (*RetryWaits) NextRetry added in v0.2.16

func (r *RetryWaits) NextRetry(key string) int64

func (*RetryWaits) Reset added in v0.2.16

func (r *RetryWaits) Reset(key string)

func (*RetryWaits) SetFail added in v0.2.16

func (r *RetryWaits) SetFail(key string) int64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL