convert

package module
v0.0.0-...-6c6e44b Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TimeLayout1 2006-01-02 15:04:05
	TimeLayout1 = "2006-01-02 15:04:05"
	// TimeLayout2 2006-01-02
	TimeLayout2 = "2006-01-02"
	// TimeLayout3 15:04:05
	TimeLayout3 = "15:04:05"
	// TimeLayout4 20060102150405
	TimeLayout4 = "20060102150405"
	// TimeLayout5 20060102
	TimeLayout5 = "20060102"
	// TimeLayout6 150405
	TimeLayout6 = "150405"
	// TimeLayout7 2006.01.02
	TimeLayout7 = "2006.01.02"
	// TimeLayout8 2006/01/02
	TimeLayout8 = "2006/01/02"
)

timestamp format layout

Variables

This section is empty.

Functions

func JsonToStruct

func JsonToStruct(data string, v any)

JsonToStruct 转换json string为struct,忽略转换错误

func MD5

func MD5(src string) string

MD5 获取字符串的MD5

func StrTime

func StrTime(timestamp int64, timeLayout string) string

StrTime 将时间戳转成字符串

func StructToJson

func StructToJson(data any) string

StructToJson 转换struct为json string

func UUID

func UUID() string

UUID 生成没有-的UUID

func UnixTime

func UnixTime(timeStr, layout string) int64

UnixTime 将字符串转成时间戳

Types

This section is empty.

Source Files

  • convert.go

Jump to

Keyboard shortcuts

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