datepart(DD,-1) sql中这么写 就可得知这个月有几天 DateTime.DaysInMonth(DateTime.Now.Year, month) 这是后台知道这个月有几天,month是月份