将其他类型转换为 LocalDates

转换 java.util.Calendar 对象:

Calendar rightNow = Calendar.getInstance();
LocalDate today = LocalDate.fromCalendarFields(rightNow);

转换 java.util.Date 对象:

Date rightNow = new Date();
LocalDate today = LocalDate.fromDateFields(rightNow);

转换字符串:

String dateString = "1960-01-01"
LocalDate birthDate = LocalDate.parse(dateString);