Initialize AutoLibrary website with Gitea deployment

This commit is contained in:
KenanZhu committed 2026-11-04 09:59:06 +08:00
commit 18216953e7
101 files changed
+12581

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
package utils
import (
"time"
)
var (
ShanghaiLocation *time.Location
)
func init() {
var err error
ShanghaiLocation, err = time.LoadLocation("Asia/Shanghai")
if err != nil {
ShanghaiLocation = time.FixedZone("CST", 8*60*60)
}
}
func NowInShanghai() time.Time {
return time.Now().In(ShanghaiLocation)
}
func ParseInShanghai(layout, value string) (time.Time, error) {
return time.ParseInLocation(layout, value, ShanghaiLocation)
}