title: Parsing date from Calendar in Java
body: <p>I am having following function</p>
  
  <pre><code>public static Date parseDate(String date, String format) throws ParseException
   {
           SimpleDateFormat formatter = new SimpleDateFormat(format);
           return formatter.parse(date);
   }
  </code></pre>
  
  <p>I am using this as follows in my code</p>
  
  <pre><code>Calendar eDate = Calendar.getInstance();
  eDate.add(Calendar.DAY_OF_MONTH,10);
  Date date = null;
    try {
     date = parseDate(eDate.getTime().toString(),"yyyy-MM-dd hh-mm-ss");
    } catch (ParseException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
    }
  </code></pre>
  
  <p>But it is throwing -</p>
  
  <pre><code> java.text.ParseException: Unparseable date
  </code></pre>
  
  <p>What is the problem here?</p>