@GetMapping("/{dateFrom}/{dateTo}")
public List<com.example.demo.attendance> getRange(@PathVariable("dateFrom") String dateFrom,@PathVariable("dateTo") String dateTo) throws ParseException{
Date date1= new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").parse(dateFrom);
Date date2= new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").parse(dateTo);
System.out.println(date1);
System.out.println(date2);
List<com.example.demo.attendance> att = this.attRepo.findDateBetween(date1,date2);
return att;
}
here i am trying tho convert the date in the format (yyyy-MM-dd) to the format in which date is saved in mongodb to perform queries