DateTimed1=newDateTime(2014,05,12,7,30,45);DateTimed2=newDateTime(2014,05,12,7,30,45);//get result of comparisonintresult=DateTimeComparator.getInstance().compare(d1,d2);switch(result){case-1:System.out.println("d1 is less than d2");break;case0:System.out.println("d1 is equal to d2");break;case1:System.out.println("d1 is greater than d2");break; default:break;}
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.