title: convert a String date of format "dd/MM/yyyy HH:mm:ss" to * java.util.Date of format dd/mm/yyyy HH:mm:ss
body: <pre><code>/**
   * 
   * Purpose:
   * 
   * 1. Need to convert a String date of format "dd/MM/yyyy HH:mm:ss" to
   * java.util.Date of format dd/mm/yyyy HH:mm:ss and convert that to
   * java.sql.Date to send to database table column of type Date.
   *
   */
  public class TestDate {
  
      public static void main(String[] args) throws ParseException {
          String inputDateStr = "10-Jan-2013";
          SimpleDateFormat inputFormatter = new SimpleDateFormat("dd-MMM-yyyy");
          SimpleDateFormat outputFormatter = new SimpleDateFormat(
                  "dd/MM/yyyy HH:mm:ss");
          java.util.Date inputDateDate = inputFormatter.parse(inputDateStr);
          System.out.println("inputDateDate :" + inputDateDate);
          // printed: inputDateDate :Thu Jan 10 00:00:00 EST 2013
  
          String requiredDateStr = outputFormatter.format(inputDateDate);
          System.out.println("requiredDateStr :" + requiredDateStr);
          // printed: requiredDateStr :10/01/2013 00:00:00
  
          /*
           * PROBLEM: Need to convert this 'requiredDateStr' ie: '10/01/2013
           * 00:00:00' to a java.util.Date type and still retain the pattern of
           * "dd/MM/yyyy HH:mm:ss"
           */
  
          //how to do this?
  
          // java.util.Date requiredDateDate = feeding requiredDateStr and format
          // of "dd/MM/yyyy HH:mm:ss"
  
          // java.sql.Date sqlDate = new Date(requiredDateDate.getTime());
  
      }
  }
  </code></pre>
  
  <p>Edit: Question: How to convert this String "10/01/2013 00:00:00" to <code>java.util.Date</code> format?</p>
  
  <p>Ultimately I want to convert this String "10/01/2013 00:00:00" to a <code>java.sql.Date</code> format</p>