ftime

package
v0.0.0-...-a2428e6 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormattedNow

func FormattedNow() (now []byte)

FormattedNow returns formatted byte time

func GetFormat

func GetFormat() (form string)

func GetLocation

func GetLocation() (loc *time.Location)

func IsDaemonRunning

func IsDaemonRunning() (running bool)

func Now

func Now() (now time.Time)

Now returns current time

func Since

func Since(t time.Time) (dur time.Duration)

Since returns the time elapsed since t. It is shorthand for fastime.Now().Sub(t).

func Stop

func Stop()

Stop stops stopping time refresh daemon

func UnixNanoNow

func UnixNanoNow() (now int64)

UnixNanoNow returns current unix nano time

func UnixNow

func UnixNow() (now int64)

UnixNow returns current unix time

func UnixUNanoNow

func UnixUNanoNow() (now uint32)

UnixUNanoNow returns current unix nano time

func UnixUNow

func UnixUNow() (now uint32)

UnixUNow returns current unix time

Types

type Ftime

type Ftime interface {
	IsDaemonRunning() bool
	GetFormat() string
	SetFormat(format string) Ftime
	GetLocation() *time.Location
	SetLocation(location *time.Location) Ftime
	Now() time.Time
	Stop()
	UnixNow() int64
	UnixUNow() uint32
	UnixNanoNow() int64
	UnixUNanoNow() uint32
	FormattedNow() []byte
	Since(t time.Time) time.Duration
	StartTimerD(ctx context.Context, dur time.Duration) Ftime
}

func New

func New() (f Ftime)

func SetFormat

func SetFormat(format string) (ft Ftime)

SetFormat replaces time format

func SetLocation

func SetLocation(location *time.Location) (ft Ftime)

SetLocation replaces time location

func StartTimerD

func StartTimerD(ctx context.Context, dur time.Duration) (ft Ftime)

StartTimerD provides time refresh daemon

Jump to

Keyboard shortcuts

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