title: How to convert String to Date in java
body: <p>I have a string something like date month year(31 08 2012) . I want to convert it to date format.</p>
  
  <pre><code>String string = "31082012";
  Date date = new SimpleDateFormat("DDMMYYYY").parse(string);
  System.out.println(date);
  </code></pre>