Documentation ¶
Index ¶
- Variables
- func AdjustMilliTimestamp(timestamp uint64, seconds int64) uint64
- func AdjustMilliTimestampByStr(timestamp uint64, shift string) (uint64, error)
- func CompareTimeStrings(t1, t2, layout string) (int, error)
- func ConvertStrMillisToTime(millis string) (time.Time, error)
- func GetMicroTimestampStr() string
- func GetMilliTimestampStr() string
- func GetNanoTimestampStr() string
- func GetTimezoneOffsetByMillis(millis int64) (string, error)
- func SetTimezone(tz ...string)
- func TimeDifference(t1, t2 string) (time.Duration, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AdjustMilliTimestamp ¶ added in v1.8.19
AdjustMilliTimestamp 根据 13 位数字毫秒时间戳和加减秒数,返回计算后的时间戳
func AdjustMilliTimestampByStr ¶ added in v1.8.25
AdjustMilliTimestampByStr 根据传入的时间单位(如 "1d", "-1m","1y")对当前时间戳进行加减,并返回结果毫秒时间戳
func CompareTimeStrings ¶ added in v1.8.68
CompareTimeStrings 比较两个时间字符串,返回 -1, 0, 1 分别表示第一个时间小于、等于、大于第二个时间
func ConvertStrMillisToTime ¶ added in v1.8.56
ConvertStrMillisToTime 将字符串格式的毫秒时间戳转换为 time.Time
func GetMicroTimestampStr ¶ added in v1.8.68
func GetMicroTimestampStr() string
GetMicroTimestampStr 当前时间的微秒时间戳字符串
func GetMilliTimestampStr ¶ added in v1.8.68
func GetMilliTimestampStr() string
GetMilliTimestampStr 当前时间的毫秒时间戳字符串
func GetNanoTimestampStr ¶ added in v1.8.68
func GetNanoTimestampStr() string
GetNanoTimestampStr 当前时间的纳秒时间戳字符串
func GetTimezoneOffsetByMillis ¶
GetTimezoneOffsetByMillis 计算客户端时区偏移量和时区名称
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.