timeUtil

package
v0.1.101 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxDayOfMonth = map[int]int{
		1:  31,
		2:  29,
		3:  31,
		4:  30,
		5:  31,
		6:  30,
		7:  31,
		8:  31,
		9:  30,
		10: 31,
		11: 30,
		12: 31,
	}
)

Functions

func GetAgeWithIdentificationNumber

func GetAgeWithIdentificationNumber(idCard string) int

func GetDateStartOrEndUnixTime

func GetDateStartOrEndUnixTime(unix int64, needMilliTime bool) (int64, int64)

获取指定天的开始或结束的时间戳 flag 1 startTime 2 endTime unix 输入的时间戳

func GetMonthMaxDay

func GetMonthMaxDay(year, month int) int

获取月份的最后一天

func GetMonthStartAndEndUnixTime

func GetMonthStartAndEndUnixTime(unix int64) (int64, int64)

获取指定月的开始和结束的时间戳 unix 输入的时间戳

func GetWeekDay added in v0.1.60

func GetWeekDay(unix int64) int

func GetWeekDayStr added in v0.1.60

func GetWeekDayStr(unix int64) string

func GetYearStartAndEndUnixTime added in v0.1.53

func GetYearStartAndEndUnixTime(unix int64) (int64, int64)

获取指定年的开始和结束的时间戳 unix 输入的时间戳

func IsThisMonth added in v0.1.24

func IsThisMonth(unix int64) bool

是否是当月

func IsThisWeek

func IsThisWeek(unix int64) bool

是否是本周

func IsToday

func IsToday(unix int64) bool

是否是今天

func IsYesterday

func IsYesterday(unix int64) bool

是否是昨天

func Substr

func Substr(str string, start, length int) string

Types

type MonthWeek

type MonthWeek struct {
	StartUnix int64
	EndUnix   int64
}

func GetAllMonthWeek added in v0.1.81

func GetAllMonthWeek(nowYear, nowMonth int, weekStartDay time.Weekday) []MonthWeek

获取月的所有周,包含跨月的

func GetMonthWeek

func GetMonthWeek(nowYear, nowMonth int) []MonthWeek

func GetMonthWeek2

func GetMonthWeek2(nowYear, nowMonth int) []MonthWeek

Jump to

Keyboard shortcuts

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