mirror of
https://github.com/usual2970/certimate.git
synced 2025-08-11 11:51:45 +00:00
init
This commit is contained in:
15
internal/utils/xtime/time.go
Normal file
15
internal/utils/xtime/time.go
Normal 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")
|
||||
}
|
Reference in New Issue
Block a user