tinytime

package
v0.0.0-...-fdc8e6b Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Unlicense Imports: 2 Imported by: 0

Documentation

Overview

TinyTime sacrifices sub-second precision and longevity for minimal time storage One aim is to avoid storing pointers to timezones, so simply UTC Uses just 4 bytes when Encoded, also low memory

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TinyTime

type TinyTime uint32

func Decode

func Decode(b []byte) TinyTime

Decode takes a byte slice of at least 4 length and takes the first bytes as the TinyTime

func NewTinyTime

func NewTinyTime(t time.Time) TinyTime

func (TinyTime) After

func (tt TinyTime) After(u TinyTime) bool

func (TinyTime) Before

func (tt TinyTime) Before(u TinyTime) bool

func (TinyTime) Encode

func (tt TinyTime) Encode(b []byte)

Encode takes a byte slice of at least length 4 and sets the first 4 bytes as the TinyTime

func (TinyTime) Equal

func (tt TinyTime) Equal(u TinyTime) bool

func (TinyTime) IsZero

func (tt TinyTime) IsZero() bool

IsZero confirms if the TinyTime is uninitialized or Unix Epoch

func (TinyTime) Time

func (tt TinyTime) Time() time.Time

Time returns the time.Time based on the TinyTime

Jump to

Keyboard shortcuts

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