使用今天的日期查看日期
我写了一些代码来检查两个日期,一个开始日期和一个结束日期。如果结束日期早于开始日期,它将给出一个提示,指出结束日期早于开始日期。
我还想添加一个检查,如果开始日期早于今天(今天和用户使用应用程序的那一天),我该怎么做?(下面的日期检查器代码,如果有任何轴承,所有这些都是为Android编写的)
if (startYear > endYear) {
fill = fill + 1;
message = message + "End Date is Before Start Date" + "\n";
} else if (startMonth > endMonth && startYear >= endYear) {
fill = fill + 1;
message = message + "End Date is Before Start Date" + "\n";
} else if (startDay > endDay && startMonth >= endMonth && startYear >= endYear) {
fill = fill + 1;
message = message + "End Date is Before Start Date" + "\n";
}