title: How to get a Date object from String
body: <pre><code>DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy' 'HH:mm:ss");
  Date d = (Date)formatter.parse(dateTime);
  System.out.println("date in controller "+d);
  </code></pre>
  
  <p>I get the output as</p>
  
  <blockquote>
    <p>date in controller Mon Dec 31 16:04:57 IST 2012</p>
  </blockquote>
  
  <p>Please suggest a method to output the date in <code>MM/dd/yyyy HH:mm:ss</code> format.
  Need the output in date format and not as string so as to store the output in <code>datetime</code> field in mysql db</p>