timeUtil

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NowFmtStr

func NowFmtStr(fmtStr string) string

func NowMillis

func NowMillis() int64

得到当前时间戳 毫秒

func NowNano

func NowNano() int64

func NowSecond

func NowSecond() int64

得到当前时间戳 秒

func NowStr

func NowStr() string

NowStr 得到当前时间的通用格式字符串

func TimeFmtStr

func TimeFmtStr(t time.Time, fmt string) string

func TimeFromStamp

func TimeFromStamp(s, ns int64) time.Time

时间戳 参数 s 为秒 ns 为纳秒 注:最后的时间为s+ns的结果 millis := nanos / 1000000 // 毫秒

func TimeFromStampMillis

func TimeFromStampMillis(ms int64) time.Time

func TimeMillis

func TimeMillis(t time.Time) int64

func TimeNano

func TimeNano(t time.Time) int64

func TimeSecond

func TimeSecond(t time.Time) int64

func TimeStr

func TimeStr(t time.Time) string

Types

type Time

type Time time.Time

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

func (Time) String

func (t Time) String() string

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) (err error)

Jump to

Keyboard shortcuts

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