clock

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(t time.Time, layout string) string

Format time

func MilliSeconds

func MilliSeconds(t time.Time) int64

MilliSeconds 返回 time.Time 的毫秒时间。

func Now

func Now(ctx context.Context) time.Time

Now 获取当前时间。

func ResetTime

func ResetTime(ctx context.Context)

ResetTime 恢复正常时间。

func SetBaseTime

func SetBaseTime(ctx context.Context, t time.Time) error

SetBaseTime 设置基准时间。

func SetFixedTime

func SetFixedTime(ctx context.Context, t time.Time) error

SetFixedTime 设置固定时间。

func ToStdLayout

func ToStdLayout(layout string) string

ToStdLayout 将 yyyy-MM-dd H:m:s 转换为 2006-01-02 15:04:05 yyyy -> 2006 MM -> 01 dd -> 02 H -> 15 m -> 04 s -> 05

Types

type FakeTime

type FakeTime interface {
	Now() time.Time
}

Jump to

Keyboard shortcuts

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