mirror of
https://github.com/usual2970/certimate.git
synced 2025-07-26 20:58:33 +00:00
.github
.vscode
docker
internal
applicant
deployer
domain
domains
notify
pkg
repository
rest
routes
utils
app
http
rand
resp
variables
xtime
time.go
migrations
ui
.dockerignore
.editorconfig
.gitignore
.goreleaser.yml
CHANGELOG.md
CONTRIBUTING.md
CONTRIBUTING_EN.md
Dockerfile
LICENSE.md
Makefile
README.md
README_EN.md
go.mod
go.sum
main.go
nixpacks.toml
usage.gif
22 lines
362 B
Go
22 lines
362 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")
|
|
}
|
|
|
|
func GetTimeAfter(d time.Duration) string {
|
|
t := time.Now().UTC()
|
|
|
|
return t.Add(d).Format("2006-01-02 15:04:05")
|
|
}
|