timex

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

time的扩展包。

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrParse = errors.New("Parse time error")
)

Functions

func After10Y

func After10Y() time.Time

func After1H

func After1H() time.Time

func After1W

func After1W() time.Time

func After1Y

func After1Y() time.Time

func DurationH

func DurationH(h int64) time.Duration

func DurationM

func DurationM(m int64) time.Duration

func DurationMS

func DurationMS(ms int64) time.Duration

func DurationS

func DurationS(s int64) time.Duration

func FromEpoch

func FromEpoch(sec int64) time.Time

func GetISO8601TimeStamp

func GetISO8601TimeStamp(ts time.Time) string

func MustParse

func MustParse(s string) time.Time

func NowEpoch

func NowEpoch() int64

func NowEpochMS

func NowEpochMS() int64

func NowSecT

func NowSecT() time.Time

func TimeStrToRFC1123

func TimeStrToRFC1123(str string) string

returns a formatted string of `time.RFC1123` format.

func TimeToUTCStr

func TimeToUTCStr(t time.Time) string

returns a utc string of a time instance.

func TimestampToHourStr

func TimestampToHourStr(ts int) string

func ToEpoch

func ToEpoch(t time.Time) int64

func ToEpochMS

func ToEpochMS(t time.Time) int64

func TryParse

func TryParse(s string) (time.Time, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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