最土的办法,就是模拟:
func calc_work_day(begin, end time.Time) int {
var workDay = 0
var curTime = begin
for {
if curTime.After(end) {
break
}
if curTime.Weekday() == time.Saturday || curTime.Weekday() == time.Sunday {
//[......]
Go计算两个时间差了几个工作日
Leave a reply