title: Difficulty while converting string(date) to milliseconds In java
body: <p>I have the following code. I am passing <code>start = "2016/01/01 23:59:59"</code> and <code>end = "2017/01/01 23:59:59"</code></p>
  
  <pre><code>func(String start, String end) {
  
      SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
      Date date1 = sdf1.parse(start);
      long startTime = date1.getTime();
      \\System.out.println(startTime);
  
      SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
      Date date2 = sdf2.parse(end);
      long endTime = date2.getTime();
      \\System.out.println(endTime);
  </code></pre>
  
  <p>}</p>
  
  <p>I am getting the following error</p>
  
  <p><code>error: unreported exception ParseException; must be caught or declared to be thrown
        Date date = sdf.parse(time);
                             ^</code></p>
  
  <p>How do I rectify this ? And also, Why is it showing me this error ?</p>