timestamp

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: GPL-2.0, MIT Imports: 3 Imported by: 1

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 FromBytes

func FromBytes(b []byte) T

FromBytes converts from a string of raw bytes.

func FromTime

func FromTime(t time.Time) T

FromTime returns a T from a time.Time

func FromUnix

func FromUnix(t int64) T

FromUnix converts from a standard int64 unix timestamp.

func Now

func Now() T

Now returns the current UNIX timestamp of the current second.

func (T) Bytes

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

func (T) I64

func (t T) I64() int64

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

func (T) Int

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

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