(((
public class Solution {
public static void main(String[] args) throws ParseException {
System.out.println(isDateOdd("APRIL 18 2000")); //эта дата минус 1 JANUARY 2000.
}
public static boolean isDateOdd(String g) throws ParseException {
SimpleDateFormat s = new SimpleDateFormat("MMMMM d yyyy");
Date yearstartTime = s.parse(g);
SimpleDateFormat begin = new SimpleDateFormat("MMMMM d yyyy");
Date current = new Date();
current.setMonth(Calendar.JANUARY);
current.setDate(1);
current.setHours(00);
long timedistance = yearstartTime.getTime() - current.getTime();
long time = 24 * 60 * 60 * 1000;
int day = (int) (timedistance / time+1);
if (day % 2 == 0) {
return false;
} else {
return true;
}
}
}