Hey guys,
Can you help me ?
package fr.codegym.task.task08.task0827;
import java.util.*;
import java.text.*;
/*
Travail avec les dates
*/
public class Solution {
public static void main(String[] args) throws Exception {
System.out.println(dateImpaire("JANUARY 2 2013"));
}
public static boolean dateImpaire(String date) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("MMM d yyyy", Locale.ENGLISH);
Date date2 = sdf.parse(date);
Date date1 = sdf.parse("JANUARY 1 2013");
int conversion = 1000*24*60*60;
long calcul = date2.getTime()/conversion - date1.getTime()/conversion;
if(calcul%2 !=0) return true;
else return false;
}
}