This commit is contained in:
yoan
2024-08-21 12:19:12 +08:00
commit 50fa238d88
89 changed files with 11835 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
package xtime
import (
"time"
)
func BeijingTimeStr() string {
location, _ := time.LoadLocation("Asia/Shanghai")
// 获取当前时间
now := time.Now().In(location)
// 格式化为字符串
return now.Format("2006-01-02 15:04:05")
}