time_helper

package
v0.0.0-...-bd0de05 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bod

func Bod(t time.Time) time.Time

Beginning of Day

func Eod

func Eod(t time.Time) time.Time

End of Day

func Format

func Format(sec int64, nsec int64, timeTemplate TimeTemplate) string

func MillisecondToTime

func MillisecondToTime(ms int64) time.Time

convert Milliseconds To Time

func Now

func Now() time.Time

func NowCST

func NowCST() time.Time

=========== CST 东八区时间================

func NowCSTMicro

func NowCSTMicro() int64

获取CST当前时间 精确到微秒

func NowCSTMill

func NowCSTMill() int64

获取CST当前时间 精确到毫秒

func NowCSTSec

func NowCSTSec() int64

获取CST当前时间 精确到秒

func NowMicro

func NowMicro() int64

获取当前时间 精确到微秒

func NowMill

func NowMill() int64

获取当前时间 精确到毫秒

func NowSec

func NowSec() int64

func NowUTC

func NowUTC() time.Time

=========== UTC 时间================

func NowUTCHour

func NowUTCHour(t time.Time) int64

func NowUTCMicro

func NowUTCMicro() int64

func NowUTCMill

func NowUTCMill() int64

func NowUTCMin

func NowUTCMin(t time.Time) int64

func NowUTCSec

func NowUTCSec() int64

func SetTimeOffsetMs

func SetTimeOffsetMs(offset int64)

func UnixHour

func UnixHour(t time.Time) int64

func UnixMicro

func UnixMicro(t time.Time) int64

func UnixMill

func UnixMill(t time.Time) int64

func UnixMin

func UnixMin(t time.Time) int64

func UnixSec

func UnixSec(t time.Time) int64

Types

type TimeTemplate

type TimeTemplate string
const (
	TimeTemplate1 TimeTemplate = "2006-01-02 15:04:05.000" // 常规类型
	TimeTemplate2 TimeTemplate = "2006/01/02 15:04:05.000" // 其他类型
	TimeTemplate3 TimeTemplate = "2006-01-02"              // 其他类型
	TimeTemplate4 TimeTemplate = "15:04:05"                // 其他类型
)

Jump to

Keyboard shortcuts

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