timestamp

package
v1.1.22 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type T

type T int64

T is a convenience type for UNIX 64 bit timestamps of 1 second precision.

func FromTime

func FromTime(t time.Time) T

FromTime returns a T from a time.Time

func FromUnix

func FromUnix(t int64) T

func Now

func Now() T

Now returns the current UNIX timestamp of the current second.

func (T) Bytes added in v1.1.20

func (t T) Bytes() (b []byte)

func (T) I64 added in v1.1.21

func (t T) I64() int64

I64 returns the current UNIX timestamp of the current second as int64.

func (T) Int added in v1.0.13

func (t T) Int() int

Int returns the timestamp as an int.

func (T) Ptr

func (t T) Ptr() *Tp

Ptr returns the pointer so values can register as nil and omitted.

func (T) Time

func (t T) Time() time.Time

Time converts a timestamp.Time value into a canonical UNIX 64 bit 1 second precision timestamp.

func (T) U64 added in v1.1.21

func (t T) U64() uint64

U64 returns the current UNIX timestamp of the current second as uint64.

type Tp

type Tp T

Tp is a synonym that makes it possible to use this value with the extra feature of the property of set/unset by the Ptr function which takes the address.

func (*Tp) Clone

func (tp *Tp) Clone() (tc *Tp)

func (*Tp) String

func (tp *Tp) String() string

func (*Tp) T

func (tp *Tp) T() T

Jump to

Keyboard shortcuts

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