date

package
v0.0.0-...-512269d Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FmtDate              = "2006-01-02"
	FmtTime              = "15:04:05"
	FmtDateTime          = "2006-01-02 15:04:05"
	FmtDateTimeNoSeconds = "2006-01-02 15:04"
)

Variables

This section is empty.

Functions

func Format

func Format(time time.Time, layout string) string

Format 时间格式化

func FromTimestamp

func FromTimestamp(timestamp int64) time.Time

FromTimestamp 毫秒时间戳转时间

func FromUnix

func FromUnix(unix int64) time.Time

FromUnix 秒时间戳转时间

func GetDay

func GetDay(time time.Time) int

GetDay return yyyyMMdd

func NowTimestamp

func NowTimestamp() int64

NowTimestamp 当前毫秒时间戳

func NowUnix

func NowUnix() int64

NowUnix 秒时间戳

func Parse

func Parse(timeStr, layout string) (time.Time, error)

Parse 字符串时间转时间类型

func Timestamp

func Timestamp(t time.Time) int64

Timestamp 毫秒时间戳

func WithTimeAsStartOfDay

func WithTimeAsStartOfDay(t time.Time) time.Time

WithTimeAsStartOfDay 返回指定时间当天的开始时间

Types

This section is empty.

Jump to

Keyboard shortcuts

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