timer

package module
v0.0.0-...-9b1b795 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 3 Imported by: 0

README

时间工具包


ctrl c/v永不过时 !!! 好用请给star。

里面没啥东西,就是放了一些工作中常使用的time包的一些方法

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TimeTemplates = map[string]string{
	"YYYYMM":              "200601",
	"YYYYWW":              "2006",
	"YYYYMMDD":            "20060102",
	"YYYY-MM-DD":          "2006-01-02",
	"YYYY/MM/DD":          "2006/01/02",
	"YYYY#MM#DD":          "2006#01#02",
	"YYYY-MM-DD hh:mm:ss": "2006-01-02 15:04:05",
	"YYYYMMDD hh:mm:ss":   "20060102 15:04:05",
	"DDHHMM":              "021504",
}

Functions

func GetMaxTimeForDay

func GetMaxTimeForDay(t time.Time) int64

func ToDDHHMM

func ToDDHHMM(t time.Time) string

func ToYYYYDay

func ToYYYYDay(t time.Time) string

func ToYYYYMM

func ToYYYYMM(t time.Time) string

func ToYYYYMMDD

func ToYYYYMMDD(t time.Time) string

func ToYYYYMMDDhhmmss

func ToYYYYMMDDhhmmss(t time.Time) string

func ToYYYYWW

func ToYYYYWW(t time.Time) string

func ToYYYY_MM_DDhhmmss

func ToYYYY_MM_DDhhmmss(t time.Time) string

func WeekByDate

func WeekByDate(t time.Time) int64

判断时间是当年的第几周

Types

This section is empty.

Jump to

Keyboard shortcuts

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