ai-week/tools/checktime.go

19 lines
346 B
Go

package tools
import (
"fmt"
"time"
)
// 当前时间是否为周五5点
func CheckTime() bool {
nowTime := time.Now()
if nowTime.Weekday().String() == "Friday" && nowTime.Format("15:04:05") == "17:00:00" {
fmt.Println("当前时间是周五5点")
return true
} else {
fmt.Println("当前时间不是周五5点")
return false
}
}