title: How to convert milliseconds to “mmm:ss” format?
body: <p>I have made class which display result in <code>mmm:ss</code> format</p>
  
  <p><strong>Below is the code:</strong></p>
  
  <pre><code>class CountDown extends CountDownTimer {
  
      public CountDown(long millisInFuture, long countDownInterval) {
          super(millisInFuture, countDownInterval);
      }
  
      @Override
      public void onTick(long millisUntilFinished) {
          long ms = millisUntilFinished;
          String text = String.format("%03d:%02d",
                  TimeUnit.MILLISECONDS.toMinutes(ms) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(ms)),
                  TimeUnit.MILLISECONDS.toSeconds(ms) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(ms)));
          tvTimer.setText(text);
      }
  
  
      @Override
      public void onFinish() {
          try {
              new AlertDialog.Builder(MCQActivity.this)
                      .setTitle("Time is over")
                      .setMessage("Your time is finished, Click on ok to go result page")
                      .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
                          public void onClick(DialogInterface dialog, int which) {
                              dialog.dismiss();
                              saveWorkAndShowResult();
  
                          }
                      })
                      .setIcon(android.R.drawable.ic_dialog_alert)
                      .show();
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>If I am passing </p>
  
  <pre><code>mCountDownTimer = new CountDown(1000 * 60 * 30, 1000);
  mCountDownTimer.start();
  </code></pre>
  
  <p>It is working fine and showing me <code>30 mins</code></p>
  
  <p>But if I want to show <code>180 min</code></p>
  
  <pre><code>mCountDownTimer = new CountDown(1000 * 60 * 180, 1000);
  </code></pre>
  
  <p>It is starting from <code>60 min</code></p>
  
  <p>Can anybody help me how to resolve this issue?</p>