clock

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

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

Format returns a textual representation of the time value formatted according to layout.

func Now

func Now(ctx context.Context) time.Time

Now returns the current local time.

func ResetTime

func ResetTime(ctx context.Context)

ResetTime resets the time to normal.

func SetBaseTime

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

SetBaseTime sets the base time.

func SetFixedTime

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

SetFixedTime sets a fixed time.

func ToStdLayout

func ToStdLayout(layout string) string

ToStdLayout converts "yyyy-MM-dd H:m:s" to "2006-01-02 15:04:05".

func UnixMilli added in v1.1.3

func UnixMilli(t time.Time) int64

UnixMilli returns t as a Unix time.

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