how to change date format in java from "yyyy-mm-dd" to "dd-mm-yyyy"

37 Views Asked by At

i used the class localDAte in a method like this :

public String dateR(int ageR) {
        LocalDate dateR= dateN.plusYears(ageR);
        return dateR.toString();
}

and it gives me the date in "yyyy-mm-dd" format however i want it in "dd-mm-yyyy" format

i want the result date in "dd-mm-yyyy" format

0

There are 0 best solutions below