title: Getting today's date in java - I've tried the regular ways
body: <p>I need today's date - and zero anything else (" 05/06/08 00:00:00 ")</p>
  
  <p>I've tried </p>
  
  <pre><code>Calendar calendar = Calendar.getInstance(); 
  calendar.set(Calendar.HOUR, 0);        
  Date date1 = calendar.getTime();                             
  System.out.println(date1);
  </code></pre>
  
  <p>Run: (This is seriously messed up)</p>
  
  <p>If the hour on the computer is &lt; 12:00 at noon :  Sun Mar 08 00:44:39 IST 2009</p>
  
  <p>If the hour on the computer is > 12:00 at noon : Sun Mar 08 12:46:53 IST 2009</p>
  
  <p>So I gave this up.</p>
  
  <p>All the Date's setters are deprecated (except the epoch time) - so I don't want to use them either</p>
  
  <p>The only thing I could think of is </p>
  
  <pre><code>Calendar calendar = Calendar.getInstance();     
  SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
  String sDate = dateFormat.format(calendar.getTime());
  Date today = dateFormat.parse(sDate);
  </code></pre>
  
  <p>But this is such a lame code I can't bring myself to write it.</p>
  
  <p>Any other option?</p>
  
  <p>Thanks!</p>