dt

package
v1.8.44 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidDurationFormat = fmt.Errorf("invalid duration format")
	ErrInvalidNumber         = fmt.Errorf("invalid number")
	ErrInvalidTimeUnit       = fmt.Errorf("invalid time unit")
)

Functions

func AdjustMilliTimestamp added in v1.8.19

func AdjustMilliTimestamp(timestamp uint64, seconds int64) uint64

AdjustMilliTimestamp 根据 13 位数字毫秒时间戳和加减秒数,返回计算后的时间戳

func AdjustMilliTimestampByStr added in v1.8.25

func AdjustMilliTimestampByStr(timestamp uint64, shift string) (uint64, error)

AdjustMilliTimestampByStr 根据传入的时间单位(如 "1d", "-1m","1y")对当前时间戳进行加减,并返回结果毫秒时间戳

func GetTimezoneOffsetByMillis

func GetTimezoneOffsetByMillis(millis int64) (string, error)

GetTimezoneOffsetByMillis 计算客户端时区偏移量和时区名称

Types

This section is empty.

Jump to

Keyboard shortcuts

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