Hi Everyone,
This has me STUMPED!
I want to check to see if the date a person enters is before or after 6 PM tomorrow. The date the user enters comes in the format MM/dd/yyyy. If it's currently before 6:00 PM then they are allowed to enter tomorrow's date or later (but not today�s date). If it's currently AFTER 6 PM, then they can only enter the day after tomorrow or later. This seems easier than it is but, for the life of me, I just can't figure it out. If anyone can help I'd really really apprecaite it. Here's what I have so far. Can anyone stear me in the right direction?
Calendar requestedDate = new GregorianCalendar();
Calendar tommorrow = new GregorianCalendar();
tommorrow.add(tommorrow.DATE, 1);
SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy");
String date = "3/20/2002";
Date parseDate = df.parse(date);
requestedDate.setTime(parseDate);
if(requestedDate.equals(tommorrow) || requestedDate.after(tommorrow) && now.get(Calendar.HOUR_OF_DAY) < 14)
{
System.out.println("no problem entering");
}
else
{
System.out.println("problems entering");
}