types

package
v0.3.31 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: 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 Time

type Time time.Time

func (Time) Add

func (t Time) Add(d time.Duration) time.Time

Add returns t with the provided duration added to it.

func (Time) Format

func (t Time) Format(layout string) string

Format returns t as a timestamp string with the provided layout.

func (Time) MarshalJSON

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

MarshalJSON is used to convert the timestamp to JSON

func (Time) String

func (t Time) String() string

String returns t as a formatted string

func (Time) Time

func (t Time) Time() time.Time

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

func (Time) UTC

func (t Time) UTC() time.Time

func (Time) Unix

func (t Time) 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 (*Time) UnmarshalJSON

func (t *Time) 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