time

package
v0.0.0-...-2692626 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const OneDaySecond int64 = 86400
View Source
const OneMinuteSecond int64 = 60

Variables

This section is empty.

Functions

func DayBeginSec

func DayBeginSec(timestamp int64) int64

DayBeginSec 返回给定 UTC 时间戳所在天的开始时间戳

func DayBeginSecByTime

func DayBeginSecByTime(t *time.Time) int64

DayBeginSecByTime 当天开始时间戳

func DayEndSec

func DayEndSec(dayBeginSec int64) int64

DayEndSec 当天最后一秒

func GenYMD

func GenYMD(sec int64) int

GenYMD 获取 e.g.:20210819

返回YMD

func NowTime

func NowTime() time.Time

Types

type Mgr

type Mgr struct {
	Second       int64     //近似时间(秒),上一次调用Update更新的时间
	Millisecond  int64     //近似时间(毫秒),上一次调用Update更新的时间
	Time         time.Time //上一次调用Update更新的时间
	SecondOffset int64     //时间偏移量-秒
}

Mgr 时间管理器

func GetInstance

func GetInstance() *Mgr

GetInstance 获取

func (*Mgr) ShadowTimeSecond

func (p *Mgr) ShadowTimeSecond() int64

ShadowTimeSecond 叠加偏移量的秒

func (*Mgr) TimeSecond

func (p *Mgr) TimeSecond() int64

TimeSecond 秒

func (*Mgr) Update

func (p *Mgr) Update()

Update 更新时间管理器中的,当前时间

Jump to

Keyboard shortcuts

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