I have an Problem with calculating an Age..
public long getAlter() {
Date now = new Date();
long yearInMillis = 365 * 24 * 60 * 60 * 1000;
long alter = (now.getTime() - buildYear.getTime()) /365/24/60/60/1000 ;
return alter;
}
- The buildYear is given: Year 22.05.2007.
--> (dd.mm.yyyy)
- I need a function to calculate the Year (not the Month or so), in this example here: 7 Years.
- I need a function to calculate the Days, in this example 2576 Days.
How can I define this?
(already choosen)
@ALL: It's not an duplicate, because I will not work with Joda!