I have a javafx.scene.control.DatePicker. I want to extract the (Locale) week number from the selected date. Until now i haven\'t found a solution and i prefer not to write
You can also use the DateTimeFormatter, looks easier for me :
LocalDate date = LocalDate.now(); DateTimeFormatter dtf = DateTimeFormatter.ofPattern("w"); int week = Integer.parseInt(date.format(dtf));