how to convert date in the format (2017-10-05) to the format in which date is saved in mongodb using java (spring ) :   @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;
	    } `