List of usage examples for org.joda.time LocalDate parse
public static LocalDate parse(String str, DateTimeFormatter formatter)
From source file:PersonClass.Person.java
public int getAge() { LocalDate Date1 = LocalDate.parse(DOB, DateTimeFormat.forPattern("dd/MM/yyyy")); LocalDate now = new LocalDate(); Years Age_1 = Years.yearsBetween(Date1, now); Age = Age_1.getYears();/*from ww w . j a v a2s. c o m*/ return Age; }
From source file:py.com.palermo.curriculolanacion.entities.Curriculo.java
public Integer getEdad() { if (anioNac != null && mesNac != null && diaNac != null) { LocalDate birthdate = LocalDate.parse(anioNac + "-" + mesNac + "-" + diaNac, DateTimeFormat.forPattern("yyyy-MM-dd")); LocalDate now = new LocalDate(); Years age = Years.yearsBetween(birthdate, now); edad = age.getYears();// ww w .j ava2 s . c o m } return edad; }