btime

package
v0.1.28 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: AGPL-3.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func CountDigit

func CountDigit(text string) int

func MSToTime

func MSToTime(timeMSecs int64) *time.Time

func Now

func Now() *time.Time

func ParseTimeMS

func ParseTimeMS(timeStr string) int64

ParseTimeMS Convert time string to 13-digit millisecond timestamp Supported forms: 将时间字符串转为13位毫秒时间戳 支持的形式: 2006 20060102 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

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

This section is empty.

Jump to

Keyboard shortcuts

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