offset

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Now added in v0.0.2

func Now() time.Time

Now 获取当前时间偏移后的时间

func SetGlobal added in v0.0.2

func SetGlobal(offset time.Duration)

SetGlobal 设置全局偏移时间

func Since added in v0.0.2

func Since(t time.Time) time.Duration

Since 获取当前时间偏移后的时间自从 t 以来经过的时间

Types

type Time

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

Time 带有偏移量的时间

func GetGlobal added in v0.0.2

func GetGlobal() *Time

GetGlobal 获取全局偏移时间

func NewTime

func NewTime(offset time.Duration) *Time

NewTime 新建一个包含偏移的时间

func (*Time) Now

func (slf *Time) Now() time.Time

Now 获取当前时间偏移后的时间

func (*Time) SetOffset

func (slf *Time) SetOffset(offset time.Duration)

SetOffset 设置时间偏移

func (*Time) Since

func (slf *Time) Since(t time.Time) time.Duration

Since 获取当前时间偏移后的时间自从 t 以来经过的时间

Jump to

Keyboard shortcuts

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