xtime

package
v0.0.0-...-e964040 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultLayout 默认时间格式
	DefaultLayout = "2006-01-02 15:04:05"
)

Variables

This section is empty.

Functions

func Format

func Format(t time.Time) string

Format 时间格式化输出

func Now

func Now() string

Now 当前时间

func NowTimestamp

func NowTimestamp() int64

NowTimestamp 当前毫秒时间戳

func Parse

func Parse(s string) time.Time

Parse 时间格式化字符串转时间

func Timestamp

func Timestamp(t time.Time) int64

Timestamp 毫秒时间戳

func TimestampParse

func TimestampParse(s string) int64

TimestampParse 时间格式化字符串转毫秒时间戳

Types

type Duration

type Duration time.Duration

func (Duration) Shrink

Shrink will decrease the duration by comparing with context's timeout duration and return new timeout\context\CancelFunc.

Jump to

Keyboard shortcuts

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