convert

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeFormat = "2006-01-02 15:04:05"
	NumberTimeFormat  = "20060102150405"
	DateTimeFormat    = "20060102"
)

Variables

This section is empty.

Functions

func FormUnixToString

func FormUnixToString(t int64, layout string) string

layout: 2006-01-02 15:04:05 、 20060102150405 、2006年01月02日 15:04:05

func GetAgeWithIDCard18

func GetAgeWithIDCard18(idCard string, refDate time.Time) int

GetAgeWithIDCard18 判断身份证相对于参考时间多少年

func GetSexWithIDCard18

func GetSexWithIDCard18(idCard string) int

GetSexWithIDCard18 判断身份证获取性别;-1未知,1性别为男,0则为女

func IsAdult

func IsAdult(idCard string) bool

IsAdult 判断身份证号是否是成年人

func Json

func Json(data interface{}) string

Json json marshal

func Misty

func Misty(raw string, b, e int, k string) string

Misty 模糊化数据,脱敏

func MistyDefault

func MistyDefault(raw string) string

func MistyMail

func MistyMail(raw string) string

func MistyMobile

func MistyMobile(raw string) string

func TimeDate added in v0.2.1

func TimeDate(t time.Time) int64

TimeNumber format number date

func TimeFormat

func TimeFormat(t time.Time) string

TimeFormat format

func TimeNumber

func TimeNumber(t time.Time) int64

TimeNumber format number

func ToCST

func ToCST(t time.Time) time.Time

ToCST set east +8

Types

This section is empty.

Jump to

Keyboard shortcuts

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