Android /java Time Format?
<p>I have time as  a "2011-12-03 12:00:19" how to convert it in "Fri 2 December 2011 " ,I know this <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html" rel="nofollow">http://docs.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html</a> ,But gives me Error:</p>

<pre><code> Exception in thread "main" java.lang.IllegalArgumentException: Cannot format given Object as a Date
    at java.text.DateFormat.format(Unknown Source)
    at java.text.Format.format(Unknown Source)
    at com.timestamp.NewTimeStamp.&lt;init&gt;(NewTimeStamp.java:21)
    at com.timestamp.NewTimeStamp.main(NewTimeStamp.java:35)
</code></pre>

<p>My code is ::</p>

<pre><code>String mytime ="2011-12-03 12:00:19";
String pattern = "EEE d MMMMM yyyy";
SimpleDateFormat dateFormat = new SimpleDateFormat(pattern);

        Date date = new Date(mytime);
        String time = dateFormat.format(date);

        System.out.println("=== &gt; " + time);
</code></pre>
