Documentation ¶
Index ¶
- Constants
- Variables
- func ASSERT(exp bool, info ...string)
- func CalcTimeSecond(stime string) (*time.Time, int64, error)
- func CatchException()
- func CatchExceptionWithName(name string)
- func CatchPanic()
- func DateStr(t time.Time) string
- func DecodeFromJson(jsonstr string, st interface{}) error
- func EncodeToJson(st interface{}) string
- func FormatJsonStr(instr string) string
- func FormatStruct(inst interface{}) string
- func GetOneMonthRangeDate(d time.Time) (time.Time, time.Time, error)
- func GetOneMonthRangeDateStr(d time.Time) (string, string, error)
- func GetTimeByChangeTimeZone(layout string, timeStr string, srcTimeZone string, destTimeZone string) (time.Time, error)
- func GetTimeFromFormat(layout string, timeStr string, location string) (time.Time, error)
- func GetTimeFromString(timeStr string) (time.Time, error)
- func GetTimeOfMs() int64
- func GetTimeOfNs() int64
- func GetTimeOfS() int64
- func GetTimeStrFromFormat(layout string, timeClass time.Time, location string) string
- func IsNullTime(t time.Time) bool
- func IsValidDate(d string) bool
- func IsValidDateTime(dt string) bool
- func IsValidTime(t string) bool
- func MakeEternalTime() time.Time
- func NowDate() string
- func NowDateStr() string
- func NowMS() string
- func NowStr() string
- func NowWithMS() string
- func RandNum(min, max int) int
- func SerializeToJson(st interface{}) string
- func Shuffle(src []string) []string
- func Time2Date(t time.Time) time.Time
- func TimeStr(t time.Time) string
- func UseMaxCpu()
Constants ¶
View Source
const ( TIME_FORMAT_WITH_T = "2006-01-02T15:04:05" TIME_FORMAT1 = "02-01-2006 15:04:00" // "dd-MM-yyyy HH:mm:ss" 秒数为 00 TIME_FORMAT2 = "02-01-2006 15:04:05" // "dd-MM-yyyy HH:mm:ss" TIME_FORMAT3 = "01/02/2006 15:04:05" // MM/DD/YYYY HH:MM:SS TIME_FORMAT4 = "2006-01-02 15:04:00" // 秒数为 00 TIME_FORMAT5 = "2006/01/02 15:04:05" // YYYY/MM/DD HH:mm:ss TIME_FORMAT_COMPACT1 = "060102150405" DATE_FORMAT1 = "2006/01/02" DATE_FORMAT_COMPACT1 = "20060102 15:04:05" MONTH_FORMAT1 = "2006-1" TIME_FORMAT_WITH_MS = "2006-01-02 15:04:05.000" TIME_FORMAT = "2006-01-02 15:04:05" TIME_FORMAT_WO_SEC_COMPACT = "200601021504" TIME_FORMAT_COMPACT = "20060102150405" TIME_FORMAT_WITH_MS_COMPACT = "20060102150405000" DATE_FORMAT = "2006-01-02" DATE_FORMAT_COMPACT = "20060102" MONTH_FORMAT = "2006-01" )
View Source
const ( TIME_LOC_ASIA_SHANGHAI = "Asia/Shanghai" //+0800 TIME_LOC_ASIA_TAIPEI = "Asia/Taipei" //+0800 TIME_LOC_AMERICA_NEW_YORK = "America/New_York" //-0400(夏) -0500(冬) TIME_LOC_UTC = "UTC" )
Variables ¶
Functions ¶
func CatchException ¶
func CatchException()
func CatchExceptionWithName ¶
func CatchExceptionWithName(name string)
func CatchPanic ¶
func CatchPanic()
func DecodeFromJson ¶
func EncodeToJson ¶
func EncodeToJson(st interface{}) string
func FormatJsonStr ¶
func FormatStruct ¶
func FormatStruct(inst interface{}) string
func GetOneMonthRangeDate ¶
get the first date and the last date of a month
func GetOneMonthRangeDateStr ¶
get the first date and the last date of a month
func GetTimeByChangeTimeZone ¶
func GetTimeByChangeTimeZone(layout string, timeStr string, srcTimeZone string, destTimeZone string) (time.Time, error)
change time zone
func GetTimeFromFormat ¶
string time to time.Time in location
func GetTimeStrFromFormat ¶
time.Time to string time in location
func IsNullTime ¶
func IsValidDate ¶
func IsValidDateTime ¶
func IsValidTime ¶
func MakeEternalTime ¶
func NowDateStr ¶
func NowDateStr() string
func SerializeToJson ¶
func SerializeToJson(st interface{}) string
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.