time

package
v2.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeFormat         = "2006-01-02 15:04:05"
	DateFormat         = "2006-01-02"
	UnixTimeUnitOffset = uint64(time.Millisecond / time.Nanosecond)
)

Variables

This section is empty.

Functions

func CurrentTimeMillis

func CurrentTimeMillis() uint64

Returns the current Unix timestamp in milliseconds.

func CurrentTimeNano

func CurrentTimeNano() uint64

Returns the current Unix timestamp in nanoseconds.

func FormatDate

func FormatDate(tsMillis uint64) string

FormatDate converts to date string tsMillis accurates to millisecond,otherwise, an error will occur

func FormatTimeMillis

func FormatTimeMillis(tsMillis uint64) string

FormatTimeMillis converts Millisecond to time string tsMillis accurates to millisecond,otherwise, an error will occur

Types

This section is empty.

Jump to

Keyboard shortcuts

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