Browse Source

增加当天结束时间函数

master v0.3.1
lijianbin 2 years ago
parent
commit
58bcbf5220
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      time.go

+ 11
- 0
time.go View File

@ -31,6 +31,17 @@ func GetTodayStartTimeStamp() int64 {
return reserveTime.Unix()
}
// 获取当天结束时间戳
func GetTodayEndTimeStamp() int64 {
var reserveTime time.Time
loc, _ := time.LoadLocation("Asia/Shanghai")
date := time.Now().Format("2006-01-02")
reserveTime, _ = time.ParseInLocation("2006-01-02 15:04:05", date+" 23:59:59", loc)
return reserveTime.Unix()
}
// 获取本周开始时间戳
func GetWeekStartTimeStamp() int64 {


Loading…
Cancel
Save