title: From post man(rest service) how to send json date(string format) to java which accepts date object
body: <p>How to bind dateOfJoining value(String type) to member variable "dateOfJoining"(Date type) in "DateInput" Class after sending below JSON through postman. How to convert String to Date object in java with the same format dd/MM/yyyy. Converted date should be in Date object but not String. </p>
  
  <p>Json is as given below</p>
  
  <pre><code>{
   "dateOfJoining" : "03/04/2017"
  }
  </code></pre>
  
  <p>Service URL hitting in postman -- localhost/Rest/hello</p>
  
  <p>RestService class in java - HandleRestRequest.java</p>
  
  <pre><code>@RestController
  public class HandleRestRequest
  {
  
    @RequestMapping("\hello");
    public List setRequestParams(@RequestBody DateInput dateInput)
   {
     .......
    }
   }
  
   Pojo Class DateInput.java
  
    public class DateInput
   {
    private  Date dateOfJoining;
     .......
    }
  </code></pre>
  
  <p>If I send date from json in below format, its throwing error as unsatisfied input</p>
  
  <pre><code> {
    "dateOfJoining" : 04/04/2017
   }
  </code></pre>
  
  <p>So I sending it as string format and by changing dateOfJoining as string in DateInput.java file and later I tried to convert it as date object as below</p>
  
  <p>Modified DateInput.java file from Date to String</p>
  
  <pre><code> public class DateInput
   {
    private  String dateOfJoining;
     .......
   }
  </code></pre>
  
  <p>Modified JSON</p>
  
  <pre><code>{
   "dateOfJoining" : "04/04/2017"
  }
  </code></pre>
  
  <p>Code to convert user input from String to Date</p>
  
  <pre><code> DateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
    String convertedDate = sdf.format(dateInput.getDateOfJoining());
  </code></pre>
  
  <p>Its converting into required format but return type is String but expected is Date object to send DAO layer. So I tried sdf.parse, its returning Date object but not in required format</p>
  
  <pre><code>Date date = sdf.parse(sdf.format(dateInput.getDateOfJoining()));
  output is like -  Tue Apr 04 00:00:00 IST 2017
  expected is 04/04/2017 (with return type Date object).
  </code></pre>
  
  <p>So please help me how to convert the string to date object with required format since DAO layer is expecting input as date object in format dd/MM/yyyy</p>