mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-09 14:09:52 +00:00
16 lines
244 B
Go
16 lines
244 B
Go
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")
|
|
}
|