How to apply applyPattern for SimpleDateFormat in java?
<p>I am trying to add a new pattern to the date display but I am not getting the result that I am expecting:</p>

<p>Here is my code:</p>

<pre><code>SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.S");
    sdf.applyPattern("yyyy-MM-dd");
     Date date_out = null;
    try {
        date_out = sdf.parse(date);
    } catch (ParseException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

((TextView) view.findViewById(R.id.date)).setText(date_out.toString());
</code></pre>

<p>I want the output to look something like this: 03 Oct 2011</p>

<p>However this is the output tat I am getting: Oct 03 00:00:00 GMT+ 11:00 2011</p>

<p>How do I reach the desired output?</p>

<p>EDIT:
I solved this code by adding this line:</p>

<pre><code>sdf.format(date_out);
</code></pre>

<p>instead of setText()</p>
