Turn formatted String into Date : <p>So I have a Date variable which I formatted using the following code:</p>

<pre><code>SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

Date currentDate = new Date();
String date = format.format(currentDate);
</code></pre>

<p>I then put the String 'date' into my database.</p>

<p>Now: I have to pull it out of the database. It comes out as, of course, a String in the format shown above.</p>

<p>My question is how do I turn this String into a date variable? I'm very much struggling to find the most efficient way. </p>

<p>Thank you.</p>
