clock

package
v1.8.9 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeFmtStrYear   = "2006"
	TimeFmtStrMonth  = "01"
	TimeFmtStrDay    = "02"
	TimeFmtStrHour   = "15"
	TimeFmtStrMinute = "04"
	TimeFmtStrSecond = "05"
)

time format alias

Variables

This section is empty.

Functions

func CurrTimeStamp

func CurrTimeStamp() int64

CurrTimeStamp return current timestamp

func CurrTimeStampString

func CurrTimeStampString() string

CurrTimeStampString return current timestamp string

func CurrTimeStr

func CurrTimeStr() string

CurrTimeStr get general layout time str: YYYY-MM-DD HH:ii:ss

func CurrTimestampInMilli

func CurrTimestampInMilli() int64

CurrTimestampInMilli get current timestamp in millisecond

func CurrTimestampInMilliString

func CurrTimestampInMilliString() string

CurrTimestampInMilliString return 1441007112776 in millisecond

func ParseTime

func ParseTime(timeStr string) (int64, error)

ParseTime parse general time layout to int64.

func RandByTime

func RandByTime(t *time.Time) int64

RandByTime random base time

func TimeGeneralLayout

func TimeGeneralLayout() string

TimeGeneralLayout general time layout: YYYY-MM-DD HH:ii:ss

func TimeStampToStr

func TimeStampToStr(timestamp int64) string

TimeStampToStr convert timestamp to string.

func TimeStr2MillsecondUnix

func TimeStr2MillsecondUnix(timeStr string) int64

TimeStr2MillsecondUnix general time string to millisecond

func TimeStr2SecondUnix

func TimeStr2SecondUnix(timeStr string) int64

TimeStr2SecondUnix time str to timestamp seconds

Types

This section is empty.

Jump to

Keyboard shortcuts

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