I have some problem while converting a localDateTime
to the format dd/MM/yyyy
Here is the method I am using:
public static Date localDateTimeToDateWithSlash(LocalDateTime localDateTime) {
if(localDateTime == null)
return null;
DateFormat format = new SimpleDateFormat("dd/MM/yyyy");
try {
return format.parse(localDateTime.format(slashDateFormater));
}
catch (Exception e) {
return null;
}
}
it returns a date, but in the format 2017-12-01T01:00
But I need it in the format dd/MM/yyyy
.