Ajout méthode tomorrowAtNoon en milliseconde

This commit is contained in:
Jacques Foucry 2016-08-30 17:58:37 +02:00
parent 11d54c36d2
commit 37468beb9e

View file

@ -91,4 +91,21 @@ public class UtilDate {
return (int) (todayDate.getTime() - oldDate.getTime());
}
/**
* @param: none
* return int
*/
public static long tomorrowAtNoon() {
Date now = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(now);
calendar.add(Calendar.DAY_OF_YEAR,1);
Date tomorrowAtNoon = dateAtNoon(calendar.getTime());
long millis = tomorrowAtNoon.getTime() - now.getTime();
return millis;
}
}