title: Android: Show elapsed time on UI for given start time and continue to update it with handler (timer)
body: <p>I get a project start time from a web service and work out the time the project had taken up to the current date. I store the datetime I get from the web in the <em>startTimeList</em>. </p>
  
  <p>Here is how I'm getting the current elapsed time on the project:</p>
  
  <pre><code>public void setTimeElapsed() {
      try {
          Calendar calStart = Calendar.getInstance();
          SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
          calStart.setTime(sdf.parse(startTimeList.get(0)));
  
          long startMillis = calStart.getTimeInMillis();
  
          long now = System.currentTimeMillis();
          long difference = now - startMillis;
  
          Calendar calDiff = Calendar.getInstance();
          calDiff.setTimeInMillis(difference);
  
          int eYear = calDiff.get(Calendar.YEAR);
          int eMonth = calDiff.get(Calendar.MONTH);
          int eDay = calDiff.get(Calendar.DAY_OF_MONTH);
          int eHour = calDiff.get(Calendar.HOUR_OF_DAY);
          int eMin = calDiff.get(Calendar.MINUTE);
          int eSec = calDiff.get(Calendar.SECOND);
  
          mimDuration.setText(String.format("%d Months %d Days %d:%d:%d", eMonth, eDay, eHour, eMin, eSec));
  
  
      } catch (ParseException e) {
          Log.e(TAG, "Error: " + e.getMessage());
      }
  }
  </code></pre>
  
  <p>However this does not keep updating the elapsed time for the user to see the real time. I need to add a handler (timer) of some sorts to keep updating the time on the UI.</p>
  
  <p>Any help would be appreciated. Thank you.</p>