How To Calculate Next Birthday From Current Date In Java?
I am retrieving different formats of birthday dates from contacts and callender application. From these dates i want to calculate number of days left for next birthday from current
Solution 1:
Simply use the Java Calendar
class to get the next years date of birth per birthday.
Calendar calendar = Calendar.getInstance();
calendar.setTime(birthdayDate);
calendar.add(Calendar.YEAR, 1); // Add one year
Date nextYear = cal.getTime();
Post a Comment for "How To Calculate Next Birthday From Current Date In Java?"