Convert to seconds from the give date format
<p>i have written the code for getting date-format from the seconds which is giving the correct result .But when i try to get the seconds from the date-format i am getting the wrong result. Here is the code </p>

<pre><code>public class DateTimeFind
{
    public static void main(String[] args){
        String seconds = "1325376000";
        DateTimeFind dtf = new DateTimeFind();
        // Displaying correct date from the given seconds
        dtf.displayDate(seconds);
        String date = "Sunday, January 1, 2012 12:00,AM";
        // Displaying wrong value of seconds from the given date.
        dtf.displaySeconds(date);
    }

    private void displayDate(String seconds){
        long startEndSec = Long.parseLong(seconds);
        SimpleDateFormat formatter = new SimpleDateFormat(
                "EEEE, MMMM d, yyyy h:mm,a", Locale.getDefault());
        formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
        String dateString = formatter.format(new Date(startEndSec * 1000L));
        System.out.println(dateString);

    }

    private void displaySeconds(String startEndDateTime){
        SimpleDateFormat sourceFormat = new SimpleDateFormat(
                "EEEE, MMMM dd, yyyy h:mm,a");
        long c = 0;
        long c1 = 0;
        try
        {
            Date t = (Date) sourceFormat.parse(startEndDateTime);
            c = t.getTime() / 1000;
        }
        catch(ParseException e)
        {
            e.printStackTrace();

        }
        System.out.println(Long.toString(c));
    }
}
</code></pre>
