date - How do I calculate someone's age in Java? - Stack Overflow
Check out Joda, which simplifies date/time calculations (Joda is also the basis of the new standard Java date/time apis, so you'll be learning a soon-to-be-standard API).
EDIT: Java 8 has something very similar and is worth checking out.
e.g.
LocalDate birthdate = new LocalDate (1970, 1, 20); LocalDate now = new LocalDate(); Years age = Years.yearsBetween(birthdate, now);Read full article from date - How do I calculate someone's age in Java? - Stack Overflow
No comments:
Post a Comment