utils

package
v0.3.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// DateFormatHyphenYearMonthDay : yyyy-mm-dd
	DateFormatHyphenYearMonthDay = "2006-01-02"
	// DateFormatHyphenYearMonthDayHourMinuteSecond : yyyy-mm-dd hh:mm:ss
	DateFormatHyphenYearMonthDayHourMinuteSecond = "2006-01-02 15:04:05"
	// DateFormatHyphenMonthDayYear : mm-dd-yyyy
	DateFormatHyphenMonthDayYear = "01-02-2006"
	// DateFormatHyphenMonthDayYearHourMinuteSecond : mm-dd-yyyy hh:mm:ss
	DateFormatHyphenMonthDayYearHourMinuteSecond = "01-02-2006 15:04:05"
	// DateFormatHyphenDayMonthYear : dd-mm-yyyy
	DateFormatHyphenDayMonthYear = "02-01-2006"
	// DateFormatHyphenDayMonthYearHourMinuteSecond : dd-mm-yyyy hh:mm:ss
	DateFormatHyphenDayMonthYearHourMinuteSecond = "02-01-2006 15:04:05"
	// DateFormatHyphenMonthDay : mm-dd
	DateFormatHyphenMonthDay = "01-02"
	// DateFormatHyphenDayMonth : dd-mm
	DateFormatHyphenDayMonth = "02-01"

	// DateFormatSlashYearMonthDay : yyyy/mm/dd
	DateFormatSlashYearMonthDay = "2006/01/02"
	// DateFormatSlashYearMonthDayHourMinuteSecond : yyyy/mm/dd hh:mm:ss
	DateFormatSlashYearMonthDayHourMinuteSecond = "2006/01/02 15:04:05"
	// DateFormatSlashMonthDayYear : mm/dd/yyyy
	DateFormatSlashMonthDayYear = "01/02/2006"
	// DateFormatSlashMonthDayYearHourMinuteSecond : mm/dd/yyyy hh:mm:ss
	DateFormatSlashMonthDayYearHourMinuteSecond = "01/02/2006 15:04:05"
	// DateFormatSlashDayMonthYear : dd/mm/yyyy
	DateFormatSlashDayMonthYear = "02/01/2006"
	// DateFormatSlashDayMonthYearHourMinuteSecond : dd/mm/yyyy hh:mm:ss
	DateFormatSlashDayMonthYearHourMinuteSecond = "02/01/2006 15:04:05"
	// DateFormatSlashMonthDay : mm/dd
	DateFormatSlashMonthDay = "01/02"
	// DateFormatSlashDayMonth : dd/mm
	DateFormatSlashDayMonth = "02/01"

	// DateFormatYear : yyyy
	DateFormatYear = "2006"
	// DateFormatHourMinuteSecond : hh:mm:ss
	DateFormatHourMinuteSecond = "15:04:05"
)

Variables

This section is empty.

Functions

func CheckStringCount

func CheckStringCount(str string, maxLen int) bool

CheckStringCount checks if the specified string length has been exceeded.

func ConvertJSTToUTC added in v0.0.19

func ConvertJSTToUTC(t time.Time) time.Time

ConvertJSTToUTC converts JST to UTC

func ConvertToString

func ConvertToString(input interface{}) (string, error)

ConvertToString converts a basic type to a string type.

func ConvertUTCToJST added in v0.0.19

func ConvertUTCToJST(t time.Time) time.Time

ConvertUTCToJST converts UTC to JST

func GetBufferFromReadCloser

func GetBufferFromReadCloser(r io.ReadCloser) ([]byte, error)

GetBufferFromReadCloser gets buffer

func GetDateFormatString added in v0.0.19

func GetDateFormatString(t time.Time, format string) string

GetDateFormatString gets format date string.

func GetDateTime added in v0.0.19

func GetDateTime(str, format string) (time.Time, error)

GetDateTime gets time.

func GetStringCount

func GetStringCount(str string) int

GetStringCount gets the number of characters in a person's view.

func GetStringFromReadCloser

func GetStringFromReadCloser(r io.ReadCloser) (string, error)

GetStringFromReadCloser gets string

func SliceUTF8

func SliceUTF8(str string, pos int) string

SliceUTF8 gets the characters from the beginning to the specified position, in UTF-8-based characters.

func SliceUTF8AddString

func SliceUTF8AddString(str string, pos int, addString string) string

SliceUTF8AddString gets the characters from the beginning to the specified position, in UTF-8-based characters.

Types

This section is empty.

Directories

Path Synopsis
aws

Jump to

Keyboard shortcuts

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