tsoutil

package
v0.0.0-...-1593278 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 2 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPhysicalDurationOnTs

func AddPhysicalDurationOnTs(ts uint64, duration time.Duration) uint64

AddPhysicalDurationOnTs adds physical interval on ts

func CalculateDuration

func CalculateDuration(ts1, ts2 typeutil.Timestamp) int64

CalculateDuration returns the number of milliseconds obtained by subtracting ts2 from ts1.

func ComposeTS

func ComposeTS(physical, logical int64) uint64

ComposeTS returns a timestamp composed of physical part and logical part

func ComposeTSByTime

func ComposeTSByTime(physical time.Time, logical int64) uint64

ComposeTSByTime returns a timestamp composed of physical time.Time and logical time

func GetCurrentTime

func GetCurrentTime() typeutil.Timestamp

GetCurrentTime returns the current timestamp

func Mod24H

func Mod24H(ts uint64) uint64

Mod24H parses the ts to millisecond in one day

func ParseAndFormatHybridTs

func ParseAndFormatHybridTs(ts uint64) string

ParseAndFormatHybridTs parses the ts and returns its human-readable format.

func ParseHybridTs

func ParseHybridTs(ts uint64) (int64, int64)

ParseHybridTs parses the ts to (physical, logical), physical part is of utc-timestamp format.

func ParseTS

func ParseTS(ts uint64) (time.Time, uint64)

ParseTS parses the ts to (physical,logical).

func PhysicalTime

func PhysicalTime(ts uint64) time.Time

func SubByNow

func SubByNow(ts uint64) int64

SubByNow ts is a hybrid

Types

This section is empty.

Jump to

Keyboard shortcuts

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