Documentation ¶
Index ¶
- Constants
- Variables
- func GBFileIsExist(filePath string) bool
- func GBFileReadAndSplitLineAsInt64Slice(filePath string) ([]int64, error)
- func GBFileReadAndSplitLineAsStringSlice(filePath string) ([]string, error)
- func GBFileReadAsInt64(filePath string) (int64, error)
- func GBFileReadAsString(filePath string) (string, error)
- func GBFileReadAsTrimString(filePath string) (string, error)
- func GBFileWriteInt64(filePath string, value int64) error
- func GBFileWriteString(filePath string, str string) error
- func GBPathAbsExecutable() string
- func GBPathAbsFolderOfExecutable() string
- func GBPathAbsRelativeExecutable(filepath string) string
- func GBStringJoinArgs(sep string, args ...interface{}) string
- func GBStringJoinAuto(sep string, sliceOrArray interface{}) string
- func GBTimeForRangeEachDay(timeBeg, timeEnd time.Time, fcb func(time.Time))
- func GBTimeFormatReadable(t time.Time) string
- func GBTimeGetStart0OfTimeDay(t time.Time) time.Time
- func GBTimeGetTodayAndAfterDays(dayCount int) []time.Time
- func GBTimeGetTodayAndAfterDaysFormat(dayCount int, fmt string) []string
- func GBTimeGetTodayAndBeforeDays(dayCount int) []time.Time
- func GBTimeGetTodayAndBeforeDaysFormat(dayCount int, fmt string) []string
- func GBTimeGetTodayFormat(fmt string) string
- func GBTimeGetTodayFormatYMDAsInt64() int64
- func GBTimeLocalDate(year int, month time.Month, day, hour, min, sec, nsec int) time.Time
- func GBTimeNowUnixMS() int64
- func GBTimeNowUnixNS() int64
- func GBTimeNowUnixS() int64
- func GBTimeNowUnixUS() int64
- func GBTimeParseFromFormatString(timestr string, fmt string) time.Time
- func GBTimeParseFromFormatStringLocation(timestr string, fmt string, local *time.Location) time.Time
Constants ¶
const ( GBTimeValFormatYMD = "20060102" GBTimeValFormatYMDSep = "2006-01-02" )
Variables ¶
var ( // 中国本地时区变量 GBTimeValLocalChina *time.Location )
Functions ¶
func GBFileReadAndSplitLineAsInt64Slice ¶
读取文件内容,按行拆分为 int64 数组
func GBFileReadAndSplitLineAsStringSlice ¶
读取文件内容,按行拆分为 string 数组
func GBFileReadAsTrimString ¶
读取文件内容作为字符串,并且修剪
func GBPathAbsRelativeExecutable ¶
获取基于当前执行程序所在目录的文件绝对路径
func GBStringJoinAuto ¶
将 数组/切片 拼接为字符串
func GBTimeForRangeEachDay ¶
从"起始时间(包含)"到"结束时间(不含)"循环范围内的每一[天],本地时区
func GBTimeFormatReadable ¶
格式化时间,变成易读的,使用内置的默认格式,只具体到毫秒
func GBTimeGetStart0OfTimeDay ¶
//////////////////////////////////////////////////////////////////////////////////////////////////////////// 传入一个时间,取得这个时间那天的起始时间,即零点的时间
func GBTimeGetTodayAndAfterDays ¶
取得当前天以及向后N天的时间
func GBTimeGetTodayAndAfterDaysFormat ¶
取得当前天以及向后N天的时间,并格式化
func GBTimeGetTodayAndBeforeDays ¶
//////////////////////////////////////////////////////////////////////////////////////////////////////////// 取得当前天以及向前N天的时间
func GBTimeGetTodayAndBeforeDaysFormat ¶
取得当前天以及向前N天的时间,并格式化
func GBTimeLocalDate ¶
//////////////////////////////////////////////////////////////////////////////////////////////////////////// 根据日期取得时间实例,中国本地时区的
func GBTimeNowUnixNS ¶
func GBTimeNowUnixNS() int64
//////////////////////////////////////////////////////////////////////////////////////////////////////////// 取得当前系统 unix 纳秒
func GBTimeParseFromFormatString ¶
通过格式化取得时间,本地时区
Types ¶
This section is empty.