time

package
v0.0.0-...-8d1786a Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 3 Imported by: 9

Documentation

Overview

Package time contains various common time separate by utility types

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentEpochNanoSecsInInt64

func CurrentEpochNanoSecsInInt64() int64

CurrentEpochNanoSecsInInt64 returns the current time as a timestamp from epoch as type int64 in nanoseconds.

func CurrentEpochSecsInFloat

func CurrentEpochSecsInFloat() float64

CurrentEpochSecsInFloat returns the current time as a timestamp from epoch as type float64 in seconds.

func CurrentEpochSecsInInt

func CurrentEpochSecsInInt() int

CurrentEpochSecsInInt returns the current time as a timestamp from epoch as type int in seconds.

func CurrentEpochSecsInInt64

func CurrentEpochSecsInInt64() int64

CurrentEpochSecsInInt64 returns the current time as a timestamp from epoch as type int64 in seconds.

func NanoSecsFromEpochToTime

func NanoSecsFromEpochToTime(ts int64) time.Time

NanoSecsFromEpochToTime converts an int64 of nanoseconds from epoch to Time struct

func SecsFromEpochToTime

func SecsFromEpochToTime(ts int64) time.Time

SecsFromEpochToTime converts an int64 of seconds from epoch to Time struct

func SecsToNanoSecsInInt64

func SecsToNanoSecsInInt64(secs int64) int64

SecsToNanoSecsInInt64 converts a value from secs to nanoseconds.

func StringToTimestamp

func StringToTimestamp(timestamp string) (int64, error)

StringToTimestamp converts a string timestamp to int64

func TimestampToString

func TimestampToString(timestamp int64) string

TimestampToString converts an int64 timestamp to string

func ToNanoSecsFromEpoch

func ToNanoSecsFromEpoch(t *time.Time) int64

ToNanoSecsFromEpoch converts a time.Time struct to nanoseconds from epoch.

func ToSecsFromEpoch

func ToSecsFromEpoch(t *time.Time) int64

ToSecsFromEpoch converts a time.Time struct to nanoseconds from epoch.

Types

This section is empty.

Jump to

Keyboard shortcuts

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