timeutil

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: Apache-2.0 Imports: 1 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 int64

Time a custom time to change the behavior of marshal

func NewTime

func NewTime(t time.Time) Time

NewTime create a Time instance with the time.Time

func Now

func Now() Time

Now returns the current local time

func (Time) MarshalText

func (t Time) MarshalText() (text []byte, err error)

MarshalText implement interface encoding.TextMarshaler

func (Time) String

func (t Time) String() string

String returns the default formatted time string

func (Time) Sub added in v0.4.4

func (t Time) Sub(u Time) time.Duration

Sub returns the duration t-u

func (Time) Time

func (t Time) Time() time.Time

Time convert to time.Time

func (Time) Unix

func (t Time) Unix() int64

Unix returns the unix time, the number of seconds elapsed since January 1, 1970 UTC

Jump to

Keyboard shortcuts

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