помогите(((
package com.javarush.task.task08.task0827;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.Date;
import java.util.Locale;
/*
Работа с датой
*/
public class Solution {
public static void main(String[] args) throws ParseException {
System.out.println(isDateOdd("MAY 1 2013"));
}
public static boolean isDateOdd(String date) throws ParseException {
SimpleDateFormat formatter = new SimpleDateFormat("MMMM d yyyy", Locale.ENGLISH);
Date date2 = formatter.parse(date);
Date date1 = formatter.parse("JANUARY 1 2013");
Instant now1 = date1.toInstant();
Instant now2 = date2.toInstant();
int amountDaysBetweenDates = (int) ChronoUnit.DAYS.between(now1, now2);
amountDaysBetweenDates = amountDaysBetweenDates - 1;
boolean answer = true;
if(amountDaysBetweenDates%2==0) {answer = false;} else {answer = true;}
return answer;
}
}