now := time.Now()
currentYear, currentMonth, _ := now.Date()
currentLocation := now.Location()
//本月6号截止
fmt.Println(time.Date(currentYear, currentMonth, 1, 0, 0, 0, 0, currentLocation).Unix()+6*24*3600-1)
//下个月6号截止
fmt.Println(time.Date(currentYear, currentMonth, 1, 0, 0, 0, 0, currentLocation).AddDate(0, 1, 0).Unix()+6*24*3600-1)
golang获取本月下个月固定日期的时间戳
最新推荐文章于 2023-04-12 13:46:08 发布