Convert String in milliseconds to Date Object (JAVA)
<p>Is there a way for me to convert a String in milliseconds to a Date object?</p>

<p>In my program, I have to convert a Date in MM/dd/yyyy format to milliseconds, but then I have to pass that to a Date object.</p>

<p>Below, <code>dateStringFinal</code> is a String with the format "MM/dd/yyyy" already.</p>

<pre><code>Calendar dateInCal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
    try {
        dateInCal.setTime(sdf.parse(dateStringFinal));
    } catch (java.text.ParseException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
String dateInMilli = String.valueOf(dateInCal.getTimeInMillis());
</code></pre>

<p>Then I have to set a date variable</p>

<pre><code>someBean.setBeginDate(dateInMilli);
</code></pre>

<p>But <code>dateInMilli</code> should be a Date object. Any ideas?</p>
