func GetTime() string {
const shortForm = "2006-01-02 15:04:05"
t := time.Now()
temp := time.Date(t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), t.Nanosecond(), time.Local)
str := temp.Format(shortForm)
fmt.Println(t)
return str
}
golang网络编程:获取当前时间戳
最新推荐文章于 2023-07-25 22:00:00 发布