timestamp

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 2 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) 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.

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.

This is to

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