timeutil

package
v0.0.49-alpha.19 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 3 Imported by: 5

Documentation

Index

Constants

View Source
const (
	TimeOffset = 8 * 3600  //8 hour offset
	HalfOffset = 12 * 3600 //Half-day hourly offset
)

Variables

This section is empty.

Functions

func GetCurDayHalfTimeFormat

func GetCurDayHalfTimeFormat() string

Get the formatted time at 12 o'clock of the day, the format is "2006-01-02_12-00-00"

func GetCurDayHalfTimestamp

func GetCurDayHalfTimestamp() int64

Get the timestamp at 12 o'clock on the day

func GetCurDayZeroTimeFormat

func GetCurDayZeroTimeFormat() string

Get the formatted time at 0 o'clock of the day, the format is "2006-01-02_00-00-00"

func GetCurDayZeroTimestamp

func GetCurDayZeroTimestamp() int64

Get the timestamp at 0 o'clock of the day

func GetCurrentTimeFormatted added in v0.0.47

func GetCurrentTimeFormatted() string

func GetCurrentTimestampByMill

func GetCurrentTimestampByMill() int64

Get the current timestamp by Mill

func GetCurrentTimestampByNano

func GetCurrentTimestampByNano() int64

Get the current timestamp by Nano

func GetCurrentTimestampBySecond

func GetCurrentTimestampBySecond() int64

Get the current timestamp by Second

func GetTimeStampByFormat

func GetTimeStampByFormat(datetime string) string

GetTimeStampByFormat convert string to unix timestamp

func TimeStringFormatTimeUnix

func TimeStringFormatTimeUnix(timeFormat string, timeSrc string) int64

TimeStringFormatTimeUnix convert string to unix timestamp

func TimeStringToTime

func TimeStringToTime(timeString string) (time.Time, error)

TimeStringToTime convert string to time.Time

func TimeToString

func TimeToString(t time.Time) string

TimeToString convert time.Time to string

func UnixMillSecondToTime

func UnixMillSecondToTime(millSecond int64) time.Time

UnixMillSecondToTime convert millSecond to time.Time type

func UnixNanoSecondToTime

func UnixNanoSecondToTime(nanoSecond int64) time.Time

Convert nano timestamp to time.Time type

func UnixSecondToTime

func UnixSecondToTime(second int64) time.Time

Convert timestamp to time.Time type

Types

This section is empty.

Jump to

Keyboard shortcuts

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