title: Date Conversion from String to sql Date in Java giving different output?
body: <p>I have a string form of Date. I have to change it to Sql Date. so for that i have used the following code. </p>
  
  <pre><code>String startDate="01-02-2013";
  SimpleDateFormat sdf1 = new SimpleDateFormat("dd-mm-yyyy");
  java.util.Date date = sdf1.parse(startDate);
  java.sql.Date sqlStartDate = new java.sql.Date(date.getTime());  
  </code></pre>
  
  <p>when i used the above code and run that. I got the following output.  </p>
  
  <pre><code>2013-01-01.  
  </code></pre>
  
  <p>Here Month is not converted correctly.<br>
  Please tell me where is the problem and provide sample code to get correct result?</p>