title: Convert the date time in yyyy-MM-dd HH:mm:ss" format
body: <p>Hi I am new to java and JPQL. here I am passing the dateTime as parameter in my url of GET method. what I want is I want user should pass  date time in "yyyy-MM-dd HH:mm:ss" format.But right now when I pass the  date time it is comapring with the current dateTime .I want it should compare the  reservations by the date and time passed by user.
   here is my  method and query. please help me..</p>
  
  <pre><code>@GET
      @Path("/getReservationByUserIdAndTypeAndDateTime/{userid}/{type}/{dateTime}")
      public List&lt;Reservation&gt; getReservationByAndUserIdAndTypeAndDateTime(@PathParam("userid") int uid, @PathParam("type") int tid,@PathParam("dateTime")String dateTime) {
          CriteriaBuilder builder = em.getCriteriaBuilder();
  
          //Timestamp dateTime = new Timestamp(System.currentTimeMillis());
       dateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime());
  
          //System.out.println("dateTime-"+dateTime);
  
          CriteriaQuery&lt;Reservation&gt; criteria = builder.createQuery(Reservation.class);
          Root&lt;Reservation&gt; r = criteria.from(Reservation.class);
          TypedQuery&lt;Reservation&gt; query = em.createQuery(
              criteria.select(r).where(new Predicate[]{
                      builder.equal(r.get(Reservation_.usersId), uid), 
                      builder.equal(r.get(Reservation_.reservationsType), tid),
                      builder.greaterThanOrEqualTo(
                             builder.concat(r.get(Reservation_.date), r.get(Reservation_.time)), dateTime.toString())}));
          return query.getResultList();
      }
  </code></pre>