Parsing long to a Date object with formatting
<p>I'm trying to do a function that will parse a long millesecond value into a Date object with formatting:</p>

<pre><code>public static Date parseDate(long millisec, String format) {
    try {
        SimpleDateFormat formatter = new SimpleDateFormat(format);
        Date formattedDate = new Date(millisec);
        formatter.format(formattedDate);
        return formattedDate;
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;    
}
</code></pre>

<p>The format I plugged into the function is this: "<code>dd-MM-yyyy HH-mm:ss</code>"
And still I am getting this result format: "<code>Thu Apr 19 19:51:22 SGT 2012</code>"</p>

<p>Any ideas why I get this kind of  result? </p>
