time

package
v0.0.0-...-969db99 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Millis

type Millis int64

Millis represents time as milliseconds since epoch without any timezone adjustments

func MillisFromInt64

func MillisFromInt64(millis int64) Millis

MillisFromInt64 generates a Millis struct from given millis int64

func MillisFromSeconds

func MillisFromSeconds(seconds int64) Millis

MillisFromSeconds generates a Millis struct from given seconds int64

func MillisFromString

func MillisFromString(s string) (Millis, error)

MillisFromString generates a Millis struct from a string representing an int64

func MillisFromTime

func MillisFromTime(t goTime.Time) Millis

MillisFromTime generates a Millis struct from given go time

func Now

func Now() Millis

Now returns current time in millis

func (Millis) IsNil

func (t Millis) IsNil() bool

IsNil returns true if the timeMillis has not been initialized to a date other then 0 from epoch

func (Millis) RoundDown

func (t Millis) RoundDown(d int64) Millis

RoundUp returns a new ToInt64 instance with a down to d millis

func (Millis) RoundUp

func (t Millis) RoundUp(d int64) Millis

RoundUp returns a new Millis instance with a rounded up to d millis

func (Millis) String

func (t Millis) String() string

func (Millis) ToInt64

func (t Millis) ToInt64() int64

ToInt64 returns the actual int64 millis since epoch

func (Millis) ToTime

func (t Millis) ToTime() goTime.Time

ToTime returns a go time.Time timestamp, UTC adjusted

Jump to

Keyboard shortcuts

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