版本封存

This commit is contained in:
zeaslity
2025-12-06 11:26:05 +08:00
parent 13949e1ba8
commit c0ae5e30c4
57 changed files with 2443 additions and 1428 deletions

View File

@@ -0,0 +1,36 @@
package utils
import (
"time"
)
var CST = time.FixedZone("CST", 8*60*60)
// CurentTimeString 获取当前时间字符串 东八区时间
func CurentTimeString() string {
return time.Now().In(CST).Format("2006-01-02 15:04:05")
}
// CurentTime 获取当前时间 东八区时间
func CurentTime() time.Time {
return time.Now().In(CST)
}
// CurentTimeUnix 获取当前时间戳 东八区时间
func CurentTimeUnix() int64 {
return CurentTime().Unix()
}
// ParseTimeString 解析时间字符串 东八区时间
func ParseTimeString(timeString string) (time.Time, error) {
return time.ParseInLocation("2006-01-02 15:04:05", timeString, CST)
}
// ParseTimeUnix 解析时间戳 东八区时间
func ParseTimeUnix(unix int64) (time.Time, error) {
return time.Unix(unix, 0).In(CST), nil
}