title: Date format conversion as a Date object in a particular format in java
body: <p>I am finding the current time using <code>Date date3 = Calendar.getInstance().getTime();</code>
  This gives me <code>Thu Oct 25 11:42:22 IST 2012</code></p>
  
  <p>Now I want my Date to be in the format <code>2012.10.25</code> and that too as a Date object and not a string.</p>
  
  <p>I tried using the below code</p>
  
  <pre><code>DateFormat df = new SimpleDateFormat("yyyy.MM.dd");
  Date startDate = df.parse(c_date1);
  </code></pre>
  
  <p>But when I finally use <code>System.out.println(startDate.toString());</code> it again gives me
  <code>Thu Oct 25 00:00:00 IST 2012.</code> that is practically because the <code>toString()</code> function has been implemented in a way to show this format.</p>
  
  <p>So is there any other way to get the date as <code>2012.10.25</code> and that too as the Date format. Date object is required because it is to be saved in db as a date field.</p>