util

package
v1.3.22 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YearOnly = "2006"
)

Variables

This section is empty.

Functions

func CanUpdate added in v1.3.22

func CanUpdate(t time.Time) bool

CanUpdate t 时间可以更新的时间, 调整到对应时分秒

func CanUpdateTime added in v1.3.22

func CanUpdateTime() time.Time

CanUpdateTime 是否可以更新

func DateZero added in v1.3.22

func DateZero(t time.Time) time.Time

DateZero t 的0点0分0秒

func Decimal

func Decimal(value float64) float64

func DifferDays added in v1.3.22

func DifferDays(t1, t2 time.Time) int

DifferDays 计算天数差 从 t1 回到 t2 需要多少天

func GOMAXPROCS added in v1.3.22

func GOMAXPROCS(n ...int)

func GetMonthDay added in v1.3.22

func GetMonthDay() (string, string)

GetMonthDay 获得当前月的初始和结束日期

func GetQuarterDay added in v1.3.22

func GetQuarterDay(months ...int) (string, string)

GetQuarterDay 获得当前季度的初始和结束日期

func GetWeekDay added in v1.3.22

func GetWeekDay() (string, string)

GetWeekDay 获得当前周的初始和结束日期

func InitTag

func InitTag(t reflect.Type, tagName string) map[int]string

InitTag 缓存Tag

func KLineRequireDays added in v1.3.22

func KLineRequireDays(currentDate, lastDay time.Time) int

func NextUpdateTime added in v1.3.22

func NextUpdateTime(t time.Time) time.Time

NextUpdateTime 下一个可以更新的日期

func ParseTime added in v1.3.22

func ParseTime(timestr string) (time.Time, error)

ParseTime 解析时间差

func Ratio

func Ratio[B stat.Number, C stat.Number](baseValue B, currentValue C) float64

func UnixTime added in v1.3.22

func UnixTime(timestamp int64) time.Time

UnixTime 毫秒数转time.Time

Types

type RatioType

type RatioType interface {
	~int | ~int32 | ~int64 | ~float32 | ~float64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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