conversion

package
v2.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// This is really the PG-dumped timestamp format
	PGTimeFormatMilli = "2006-01-02 15:04:05.999"
	PGTimeFormatMicro = "2006-01-02 15:04:05.999999"
)

Variables

This section is empty.

Functions

func EpochStamp2MicroTime

func EpochStamp2MicroTime(timestamp int64) time.Time

EpochStamp2MicroTime converts a UNIX epoch time in microsecond (int64) to a local timestamp

func EpochStamp2MilliTime

func EpochStamp2MilliTime(timestamp int64) time.Time

EpochStamp2MilliTime converts a UNIX epoch time in millisecond (int64) to a local timestamp

func EpochStamp2PGMilliTimeString

func EpochStamp2PGMilliTimeString(tsEpoch int64) string

func Time2MilliStamp

func Time2MilliStamp(t time.Time) int64

Time2MilliStamp converts a local timestamp to a UNIX epoch time in millisecond (int64)

func Time2MircoStamp

func Time2MircoStamp(t time.Time) int64

Time2MircoStamp converts a local timestamp to a UNIX epoch time in mircosecond (int64)

func Time2SecondStamp

func Time2SecondStamp(t time.Time) int64

Time2SecondStamp converts a local timestamp to a UNIX epoch time in second (int64)

func TimeString2MicroTime

func TimeString2MicroTime(s string) (time.Time, error)

TimeString2MicroTime converts a postgres raw (microsecond) time string into a local time

func TimeString2MilliTime

func TimeString2MilliTime(s string) (time.Time, error)

TimeString2MilliTime converts a postgres raw (millisecond) time string into a local time

Types

This section is empty.

Jump to

Keyboard shortcuts

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