Example #1
0
func DateStr(timeStamp string, format string) string {
	i, err := strconv.ParseInt(timeStamp, 10, 64)
	if err != nil {
		return ""
	}
	return utils.TimeFormat(time.Unix(i, 0), format)
}
Example #2
0
func Date(timeStamp int64, format string) string {
	return utils.TimeFormat(time.Unix(timeStamp, 0), format)
}
Example #3
0
func showTime() error {
	fmt.Println("现在的时间是:", utils.TimeFormat(time.Now(), "Y-m-d H:i:s"), " AND the rand is ", test1())
	return nil
}