helps

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const OneDaySec = int64(86400)

Variables

This section is empty.

Functions

func BytesToInt64

func BytesToInt64(bs []byte, defaultValue int64) int64

func CopyPoint

func CopyPoint[T any](m T) T

func DecryptByDESAndCBC

func DecryptByDESAndCBC(cipherText []byte) ([]byte, error)

func Duration

func Duration(s, e int64) string

func Duration2

func Duration2(start, end int64) string

func DurationSecondsOfMonth

func DurationSecondsOfMonth(s int64) (int64, int64)

func EncryptByDESAndCBC

func EncryptByDESAndCBC(textBytes []byte) ([]byte, error)

func FirstSecond

func FirstSecond(t time.Time) int64

func FirstSecond2

func FirstSecond2(s int64) int64

func FormatDate

func FormatDate(ts int64) string

func FormatTime

func FormatTime(ts int64) string

func GetFirstDateOfMonth

func GetFirstDateOfMonth(d time.Time) time.Time

GetFirstDateOfMonth 获取传入的时间所在月份的第一天,即某月第一天的0点。如传入time.Now(), 返回当前月份的第一天0点时间。

func GetLastDateOfMonth

func GetLastDateOfMonth(d time.Time) time.Time

GetLastDateOfMonth 获取传入的时间所在月份的最后一天,即某月最后一天的23:59:59。如传入time.Now(), 返回当前月份的最后一天0点时间。

func GetZeroTime

func GetZeroTime(d time.Time) time.Time

GetZeroTime 获取某一天的0点时间

func NonceStr

func NonceStr() string

func PKCS5Padding

func PKCS5Padding(ciphertext []byte, blockSize int) []byte

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

func SafePage

func SafePage[T constraints.Integer](i T) T

func Str2Time

func Str2Time(str string) time.Time

func StrToTime

func StrToTime(str string) int64

func ToBool

func ToBool[T constraints.Integer](i T) bool

func TodayFirstSecond

func TodayFirstSecond() int64

Types

type Cmp

type Cmp interface {
	Less()
}

Jump to

Keyboard shortcuts

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