timeutils

package
v1.8.6 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertMilliseconds

func AssertMilliseconds(ms int64) (timestampMilliseconds int64, err error)

AssertMilliseconds ensures that a given timestamp is in milliseconds. If not, a timestamp converted into milliseconds as well as an error will be returned.

func AssertSeconds

func AssertSeconds(timestamp int64) (timestampSeconds int64, err error)

AssertSeconds ensures that a given timestamp is in seconds. If not, a timestamp converted into seconds as well as an error will be returned.

func GetPeriodsStartAndEndUTC

func GetPeriodsStartAndEndUTC(firstyyyymm string, lastyyyymm string) (int64, int64, error)

GetPeriodsStartAndEndUTC returns the start and end timestamps (in milliseconds) given two months for location UTC (timezone)

func MillisecondsNow

func MillisecondsNow() int64

MillisecondsNow returns milliseconds for time now

func MillisecondsTime

func MillisecondsTime(ms int64) time.Time

MillisecondsTime returns a Time struct for a given millisecond timestamp

func MillisecondsUnix

func MillisecondsUnix(t time.Time) int64

MillisecondsUnix returns milliseconds for given time

Types

This section is empty.

Jump to

Keyboard shortcuts

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