timeutils

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UnixTime

type UnixTime time.Time

Time defines a timestamp encoded as epoch seconds in JSON

func (UnixTime) MarshalJSON

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

MarshalJSON is used to convert the timestamp to JSON

func (UnixTime) String

func (t UnixTime) String() string

String returns t as a formatted string

func (UnixTime) Time

func (t UnixTime) Time() time.Time

Time returns the JSON time as a time.Time instance in UTC

func (UnixTime) Unix

func (t UnixTime) Unix() int64

Unix returns t as a Unix time, the number of seconds elapsed since January 1, 1970 UTC. The result does not depend on the location associated with t.

func (*UnixTime) UnmarshalJSON

func (t *UnixTime) UnmarshalJSON(s []byte) (err error)

UnmarshalJSON is used to convert the timestamp from JSON

Jump to

Keyboard shortcuts

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