는 어떻게 위에서 죽음의 나이를 계산할 수 있습니다. 나는 어떤 externallibraries를 사용하고 싶지 않다.가능한 중복은 : 사망 당시의 나이를 어떻게 계산합니까?
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); if(petDetails.getDateOfDeath() != null){ String formatedDateOfDeath = formatter.format(petDetails.getDateOfDeath()); String formateDateOfBirth = formatter.format(petDetails.getDateOfBirth()); }
How can I calculate the age of a person in year, month, days?
How can I calculate the difference between two dates
EDIT : 내가 지금까지 가지고있는 것을 보아라. 다른 스레드들 중 아무 것도 나의 것과 같다. 대부분은 DOB에서 오늘에 이르기까지이며, 사용하는 형식이 아닙니다.
가능한 중복 [년, 월, 일의 나이를 어떻게 계산할 수 있습니까?] (http://stackoverflow.com/questions/453208/how-can-i-calculate-the-age-of - 사람 - 년 - 월 - 일). [이 답변] (http://stackoverflow.com/questions/9/how-do-i-calculate-someones-age-in-c/11942#11942)도 참조하십시오. –
또는 http://stackoverflow.com/questions/1116123/how-do-i-calculate-someones-age-in-java –
한 시간 전 그의 질문과 중복 될 수 있습니다. http://stackoverflow.com/questions/5194216/how-can-i-calculate-the-difference-between-two-dates-closed – Riggy