until

package
v0.0.0-...-6f9dc6e Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DateLayout = "2006-01-02"
	TimeLayout = "15:04:05"
	CSTLayout  = DateLayout + " " + TimeLayout
)

Variables

This section is empty.

Functions

func BytesToString

func BytesToString(data *[]byte) string

func CSTLayoutString

func CSTLayoutString() string

CSTLayoutString 格式化时间 返回 "2006-01-02 15:04:05" 格式的时间

func CSTLayoutStringToUnix

func CSTLayoutStringToUnix(cstLayoutString string) (int64, error)

CSTLayoutStringToUnix 返回 unix 时间戳 2020-01-24 21:11:11 => 1579871471

func GMTLayoutString

func GMTLayoutString() string

GMTLayoutString 格式化时间 返回 "Mon, 02 Jan 2006 15:04:05 GMT" 格式的时间

func IncludeLetter

func IncludeLetter(str string) bool

func Int64ToString

func Int64ToString(num int64) string

func IntToString

func IntToString(num int) string

func IsDigit

func IsDigit(str string) bool

func ParseCSTInLocation

func ParseCSTInLocation(date string) (time.Time, error)

ParseCSTInLocation 格式化时间

func ParseGMTInLocation

func ParseGMTInLocation(date string) (time.Time, error)

ParseGMTInLocation 格式化时间

func PbTimeToDate

func PbTimeToDate(ts *timestamppb.Timestamp) string

PbTimeToDate 将 protobuf 时间转换成 yyyy-mm-dd 格式

func RFC3339ToCSTLayout

func RFC3339ToCSTLayout(value string) (string, error)

RFC3339ToCSTLayout convert rfc3339 value to china standard time layout 2020-11-08T08:18:46+08:00 => 2020-11-08 08:18:46

func RandomString

func RandomString(n int) string

RandomString 生成随机字符串。参考:https://colobu.com/2018/09/02/generate-random-string-in-Go/

func StringToBytes

func StringToBytes(data string) (b []byte)

func StringToUint64

func StringToUint64(num string) uint64

func TimeToDate

func TimeToDate(time time.Time) string

TimeToDate 将时间转换为 yyyy-mm-dd 格式

func TimeToDateTime

func TimeToDateTime(time time.Time) string

TimeToDateTime 将时间转换为 yyyy-mm-dd HH:ii:ss 格式

func TimeToPb

func TimeToPb(time time.Time) *timestamppb.Timestamp

TimeToPb 将时间转换成 PbTime

func Uint64ToString

func Uint64ToString(num uint64) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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