C#中 DateTime类型的变量格式是:2015/12/11 13:58:59
如果只比较年月日而不比较时分秒,可以:
nowTime = Convert.ToDateTime(nowTime.ToShortDateString()); startTime = Convert.ToDateTime(startTime.ToShortDateString()); endTime = Convert.ToDateTime(endTime.ToShortDateString());
这样会把时分秒全部置为0,如:2015/12/11 0:00:00