requirements: input into method are 3 Strings representing the person's birth year, month and day ( YYYY, MM, DD ). Returns the person's age as an integer. current method:
it seems a little clunky to me. Someone out there must have a cleaner way. Thanx, Jamie
You may convert the birthday in second unit(note that before 1970 is negative value). Then get the current time using System.getCurrentTimeMillis() and change it to second by dividing 1000. Define number of second in a year which is 365*24*60*60. Then age should be (current_time-birthday)/second_year. Just a thought.