如何检查日期 11/10/2011 < strong>和 '11 / 15/2014' ?
答案 0 :(得分:1)
以下显示使用DateTime的示例:
var startDate = new DateTime(2014,11,10);
var endDate = new DateTime(2014,11,15);
var dateToCheck = new DateTime(2014,11,12);
if(startDate < dateToCheck && endDate > dateToCheck)
{
// Do something
}
答案 1 :(得分:0)
if (dateToBeChecked > lowDate && dateToBeChecked < highDate)
{
// do this where the date is between the dates specified
}
else
{
// do something else
}