Date formatting issue in java
<p>When I parsing time in java, I passing "12:12" as string argument, then I am getting <strong>"Thu Jan 01 12:12:00 IST 1970"</strong> as a output.</p>

<p>I want current year like <strong>"Fri Mar 09 12:12:00 IST 2012"</strong> as a output.</p>

<pre><code>String timestr = "12:12";
Date convertedDate = null;
try {
  SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm");
  convertedDate = dateFormat.parse(timestr);
} catch (ParseException e) {
  e.printStackTrace();
}
System.out.println(convertedDate);
</code></pre>

<p>Thanks!</p>
