mytime

package
v1.11.30 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: BSD-3-Clause Imports: 1 Imported by: 3

Documentation

Index

Constants

View Source
const (
	FormatYYYYMMDDHHMISS = "2006-01-02 15:04:05"
)

Variables

View Source
var (
	CstZone     = time.FixedZone("CST", 8*3600)
	CstSh, _    = time.LoadLocation("Asia/Shanghai") //上海
	CstLocal, _ = time.LoadLocation("Local")
	CstUTC, _   = time.LoadLocation("UTC")

	TimeTemplate1 = "2006-01-02 15:04:05"
	TimeTemplate2 = "2006/01/02 15:04:05"
	TimeTemplate3 = "2006-01-02"
	TimeTemplate5 = "20060102 150405"
	TimeTemplate6 = "20060102"
)

Functions

func BeginningOfDay added in v1.10.0

func BeginningOfDay(t time.Time) time.Time

func CurrBeginningOfDay added in v1.10.1

func CurrBeginningOfDay() time.Time

func CurrEndOfDay added in v1.10.1

func CurrEndOfDay() time.Time

func EndOfDay added in v1.10.0

func EndOfDay(t time.Time) time.Time

EndOfDay 返回指定日期的结束时间

func GetDaysInMonth

func GetDaysInMonth(yearInt, month int) (days int)

给定年月值,获取该月有多少天

func TruncateMillSec

func TruncateMillSec(in time.Time) time.Time

func TruncateMinute

func TruncateMinute(in time.Time) time.Time

func TruncateSec

func TruncateSec(in time.Time) time.Time

func UnixNano added in v1.10.8

func UnixNano(nanoSec int64) time.Time

Types

This section is empty.

Jump to

Keyboard shortcuts

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