calculating years between two dates
hi everyone, im very new to java and i am having a lot of trouble with this.
write a program that reads in the year, month, and day of a couple's wedding date and compute thier next wedding anniversary after March 2, 2011.
TThis has to be input in a message dialog box also.
if someone could show me how to do this step by step that would be amazing.
Re: calculating years between two dates
Create a Calendar, set the Date of the Calendar using the information requested. Then set the year to 2011 (unless the year is already later than that), then compare that Date (see the API for a Calendar method to get the resulting Date) with a Date for March 2, 2011 and if it is before that, then add another year.