How to convert a string to date format in java?
<p>How to convert a String to <code>DateFormat</code> in java?</p>

<p>I am writing a application where I want to convert a string "20050105000200" to "2005-01-05 00:02:00". Is there a direct way to do it in Java? I want both input and output in String. Please let me know if there is a way to do it directly.</p>

<p>Can you give me some simple codes?</p>

<p>Thanks.</p>
