datetime

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LayoutDate     = "2006-01-02"
	LayoutTime     = "15:04:05"
	LayoutDateTime = "2006-01-02 15:04:05"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Time

type Time struct {
}

func NewTime

func NewTime() *Time

func (*Time) DateTimeToUnix

func (*Time) DateTimeToUnix(t string) (int64, error)

DateTimeToUnix 日期字符串转时间戳

func (*Time) GetDateByStr added in v1.0.1

func (obj *Time) GetDateByStr(str, local string) time.Time

func (*Time) GetDateTimeByStr added in v1.0.1

func (obj *Time) GetDateTimeByStr(str, local string) time.Time

func (*Time) GetLocal added in v1.0.1

func (*Time) GetLocal(local string) *time.Location

func (*Time) GetStrDate added in v1.0.1

func (*Time) GetStrDate() string

GetStrDate 返回年月日

func (*Time) GetStrDateTime added in v1.0.1

func (*Time) GetStrDateTime() string

GetStrDateTime 返回年月日时分秒

func (*Time) GetStrTime added in v1.0.1

func (*Time) GetStrTime() string

GetStrTime 返回年月日时分秒

func (*Time) GetTimeByStr added in v1.0.1

func (obj *Time) GetTimeByStr(str, local string) time.Time

func (*Time) MilliSecondToDateTime

func (*Time) MilliSecondToDateTime(t int64) string

MilliSecondToDateTime 毫秒转日期

func (*Time) RunTime

func (*Time) RunTime(callback func()) time.Duration

RunTime 计算程序运行时间

func (*Time) SleepRange

func (*Time) SleepRange(max, min int)

SleepRange 随机睡眠指定范围毫秒

func (*Time) UnixToDateTime

func (*Time) UnixToDateTime(t int64) string

UnixToDateTime 时间戳转日期

Jump to

Keyboard shortcuts

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