timestamp

package module
v0.0.0-...-2911945 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2018 License: MIT Imports: 1 Imported by: 0

README

timestamp

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultLocation = time.Local
)

Functions

This section is empty.

Types

type TimeStamp

type TimeStamp int64

TimeStamp defines a timestamp

func TimeStampNow

func TimeStampNow() TimeStamp

TimeStampNow returns now int64

func (TimeStamp) Add

func (ts TimeStamp) Add(seconds int64) TimeStamp

Add adds seconds and return sum

func (TimeStamp) AddDuration

func (ts TimeStamp) AddDuration(interval time.Duration) TimeStamp

AddDuration adds time.Duration and return sum

func (TimeStamp) AsTime

func (ts TimeStamp) AsTime() (tm time.Time)

AsTime convert timestamp as time.Time in Local locale

func (TimeStamp) AsTimePtr

func (ts TimeStamp) AsTimePtr() *time.Time

AsTimePtr convert timestamp as *time.Time in Local locale

func (TimeStamp) Format

func (ts TimeStamp) Format(f string) string

Format formats timestamp as

func (TimeStamp) FormatLong

func (ts TimeStamp) FormatLong() string

FormatLong formats as RFC1123Z

func (TimeStamp) FormatShort

func (ts TimeStamp) FormatShort() string

FormatShort formats as short

func (TimeStamp) IsZero

func (ts TimeStamp) IsZero() bool

IsZero is zero time

func (TimeStamp) Year

func (ts TimeStamp) Year() int

Year returns the time's year

type TimeStampNano

type TimeStampNano int64

TimeStampNano defines a timestamp to nano

func TimeStampNanoNow

func TimeStampNanoNow() TimeStampNano

TimeStampNow returns now int64

func (TimeStampNano) Add

func (ts TimeStampNano) Add(seconds int64) TimeStampNano

Add adds seconds and return sum

func (TimeStampNano) AddDuration

func (ts TimeStampNano) AddDuration(interval time.Duration) TimeStampNano

AddDuration adds time.Duration and return sum

func (TimeStampNano) AsTime

func (ts TimeStampNano) AsTime() (tm time.Time)

AsTime convert timestamp as time.Time in Local locale

func (TimeStampNano) AsTimePtr

func (ts TimeStampNano) AsTimePtr() *time.Time

AsTimePtr convert timestamp as *time.Time in Local locale

func (TimeStampNano) Format

func (ts TimeStampNano) Format(f string) string

Format formats timestamp as

func (TimeStampNano) FormatLong

func (ts TimeStampNano) FormatLong() string

FormatLong formats as RFC1123Z

func (TimeStampNano) FormatShort

func (ts TimeStampNano) FormatShort() string

FormatShort formats as short

func (TimeStampNano) IsZero

func (ts TimeStampNano) IsZero() bool

IsZero is zero time

func (TimeStampNano) Year

func (ts TimeStampNano) Year() int

Year returns the time's year

Jump to

Keyboard shortcuts

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