Get value from Date picker
问题 I want to get the value from JavaFX datepicker and store the value as Date Object: final DatePicker datePicker = new DatePicker(LocalDate.now()); Date date = datePicker.getValue(); grid.add(datePicker, 1, 9); Can you tell me how I can convert LocalDate to Date ? 回答1: As the name implies, LocalDate does not store a timezone nor the time of day. Therefore to convert to an absolute time you must specify the timezone and time of day. There is a simple method to do both, atStartOfDay(ZoneId). Here