title: is it possible to get formatted date object in Java
body: <pre><code>     SimpleDateFormat formatter= 
        new SimpleDateFormat("yyyy MMM dd");
       String dateNow = formatter.format(rs.getDate("ExpirationDate").getTime());
  System.out.println("Date in String: "+dateNow);
       expDate = formatter.parse(dateNow);
  System.out.println("expDate: "+expDate);
  </code></pre>
  
  <p>Here is the code through which I am trying to format the date to <code>2013 Apr 26</code> format.Now <code>SimpleDateFormat#format</code> method returns a formatted String but I need a <code>java.util.Date</code> object with desired format? Is it possible<br><strong>Note:</strong> Actually I need the date object becuase I have to print it on my JSF page and when I tried to print it on JSF it shows defualt format of <code>java.util.Date</code> i-e <code>Mon Mar 04 00:00:00 PKT 2013</code> whereas I want this <code>2013 Apr 26</code><br/>
  Another thing is that I found a annotation is Spring framework which is <code>@DateTimeFormat(pattern = "yyyy MMM dd")</code> which works itself.Is there anything like this annotation in JSF 2.0.<br/>Thanks</p>