代码拉取完成,页面将自动刷新
package common
import (
"time"
)
// GetYear 获取年,输出格式“2006”
func GetYear() (date string) {
date = time.Now().Format("2006")
return
}
// GetMonth 获取月,输出格式“01”
func GetMonth() (date string) {
date = time.Now().Format("01")
return
}
// GetDay 获取日,输出格式“02”
func GetDay() (date string) {
date = time.Now().Format("02")
return
}
// GetHour 获取时,输出格式“15”
func GetHour() (date string) {
date = time.Now().Format("15")
return
}
// GetMinute 获取分,输出格式“04”
func GetMinute() (date string) {
date = time.Now().Format("04")
return
}
// GetSecond 获取秒,输出格式“05”
func GetSecond() (date string) {
date = time.Now().Format("05")
return
}
// GetYearMonthDay 获取年月日,输出格式“2006-01-02”
func GetYearMonthDay() (date string) {
date = time.Now().Format("2006-01-02")
return
}
// GetHourMinuteSecond 获取时分秒,输出格式“15:04:05”
func GetHourMinuteSecond() (date string) {
date = time.Now().Format("15:04:05")
return
}
// GetYearMonthDayHourMinuteSecond 获取年月日时分秒,输出格式“2006-01-02 15:04:05”
func GetYearMonthDayHourMinuteSecond() (date string) {
date = time.Now().Format("2006-01-02 15:04:05")
return
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。