encodedTime

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Millisecs added in v1.5.0

type Millisecs time.Time

Millisecs is used to get a time from an js number that represents a timestamp in milliseconds

func NewMillisecs added in v1.5.0

func NewMillisecs(secs int64) Millisecs

NewMillisecs returns a Millisecs instance with secs converted to millisecs (*1000)

func (Millisecs) MarshalJSON added in v1.5.0

func (t Millisecs) MarshalJSON() ([]byte, error)

func (*Millisecs) UnmarshalJSON added in v1.5.0

func (t *Millisecs) UnmarshalJSON(in []byte) (err error)

type Unix

type Unix time.Time

Unix converts unix times to time.Time

func NewUnix

func NewUnix(secs int64) Unix

NewUnix returns a Unix instance with secs since unix-0

func (Unix) MarshalJSON

func (t Unix) MarshalJSON() ([]byte, error)

MarshalJSON takes the Unix() seconds from the time and uses strconv.FormatInt() to return the string of digits

func (*Unix) UnmarshalJSON

func (t *Unix) UnmarshalJSON(in []byte) (err error)

UnmarshalJSON for Unix converts the []byte value to int64 seconds and than constructs the time with time.Unix()

Jump to

Keyboard shortcuts

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